What happened to my Windows (.bat) file?
I created a simple batch file (.bat) containing a bunch of commands that should run automatically in a command window. The package looks like this:
mmd dll1.dll -mf -aW
mmd dll2.dll -mf -aW
mmd dll3.dll -mf -aW
If I copy and paste a bunch of cmds into the command window, they all execute correctly. However, if I try to directly drag and drop the batch file into the command window and execute it, the first command runs and does not succeed. Why?
In the command window where I run the commands, many environment variables need to be set before the commands can run successfully. When I drag and drop the batch file (with an absolute path) it looks like I have never set these variables. Are commands from a batch file being executed in the same context using the hosting command prompt window? How should I do it?
source to share
Perhaps you have special characters in your commands that affect batch files, like%. You will need to remove / delete them.
If not, it probably has to do with the program you are running, either messing with the terminal, or being very dependent on your environment. Do you have information about this? Try to run only the first line in the batch file.
source to share