As far as I can tell this is perfectly valid batch-file code, just a very simple echo command, but everytime I run it, it does nothing – it doesn’t echo the text to any window at all.
@echo off
ECHO Hello World
Anyone have any idea what I’m doing wrong here? It works fine in a CMD window, so my best guess is that maybe a batch file requires a bit more code to get working? Other than that, not a clue.
Without a
PAUSEat the end, the command window (if you run the .bat file directly) will briefly flash and then disappear, because the script finishes running and closes the command window. If you run through Command Prompt, there isn’t the issue, as you’ve mentioned above.To mitigate the issue,
PAUSEthe window once you’ve finishedECHO-ing: