Peculiar batch file behavior

K

Knack

I want to test my batch file, but it won't run if I double-click on its file
icon (.bak), nor if I type its path into the Start > Run field, and click
OK. A blank <cmd.exe> window appears. However, if I copy the contents of
that file and paste it into a command prompt window, then it runs. Why?
Does <cmd.exe> require some sort of initial setup configuration before it
can run batch files?
 
P

Pegasus \(MVP\)

Knack said:
I want to test my batch file, but it won't run if I double-click on its file
icon (.bak), nor if I type its path into the Start > Run field, and click
OK. A blank <cmd.exe> window appears. However, if I copy the contents of
that file and paste it into a command prompt window, then it runs. Why?
Does <cmd.exe> require some sort of initial setup configuration before it
can run batch files?

Batch files must have an extension of .bat or .cmd, not .bak.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top