Cramer pushes back on critics who might say Home Depot is just publicity-hungry.

CNBC's Jim Cramer has found one surefire way to boost your stock on a tepid day like Wednesday: say you're making investments in technology to make your company more efficient.

"Just look at the stock of Home Depot HD ," the " Mad Money " host said. "[It] announced this morning that it's hiring 1,000 technical professionals as part of its $11 billion strategic investment plan, and [its stock] was rewarded with a nearly 3 percent rally."

Home Depot's stock finished Monday's trading session at $179.85 a share, up $4.94 per share.

While some might argue that Home Depot is just a "publicity-hungry" retailer trying to artificially raise its stock price or attract investors, Cramer wasn't so quick to bash the home improvement chain.

Cramer recalled what Marc Benioff , the founder, chairman and CEO of Salesforce.com CRM , told him about Home Depot's Chief Investment Officer, Matt Carey: that he "is a legend in information technology" who "has personally transformed" his company to fit the digital landscape.

"Home Depot's been pulling away from its competition and staying ahead of even Amazon AMZN thanks to its homegrown technology effort run by its chief investment officer ... that marries engineers with product managers and salespeople who understand the customer experience," the "Mad Money" host said.

Cramer added that Home Depot's efforts are no publicity stunt: the company spends heavily on technology, sponsors "Battle of the Brains" events to recruit coders, hires hundreds of tech employees right out of school and trains tech-savvy employees in 12-week boot camps.

The "Mad Money" host said these initiatives are a direct response to the changing brick-and-mortar landscape, which is increasingly threatened by Amazon's speed and convenience.

Retailers that have staved off Amazon have focused on creating technology that is strong enough to compete with the e-commerce giant, Cramer continued.

Home Depot, for one, built a mobile app that lets customers speak into their phone and request a product and then shows them where to find it in the store.

"How can you compete with that? I think it's impossible, frankly, which is why so many mom-and-pop hardware stores have gone under despite their often superior personal touch," Cramer said. "It's why even arch-rival Lowe's LOW is losing in the two-way national race, because the contractors of the world don't have time to go to Lowe's anymore."

Cramer sees the trend stretching beyond Home Depot. He attributed CSX's profit boost to increased efficiency at the railroad operator, much of which stemmed from tech improvements.

"Here's the bottom line: tech isn't just FANG , for heaven's sake, my acronym for Facebook FB , Amazon, Netflix and Google, now Alphabet ," the "Mad Money" host said. "It's about the companies that employ tech to trounce the competition in the information technology field. It's about the railroads or it's about a big orange chain store called Home Depot. With tech, if you live without it, you wither on the vine."