What is the difference between following commands:
start %comspec% /c script.cmd
start cmd /C script.cmd
I need that cmd window for script.cmd should close automatically when script.cmd is finished.
The difference is that "%comspec%" should expand to the default command interpreter, whereas "cmd" searches for a cmd executable and invokes it. Most of the time they are the same.
But in case there is a cmd executable (cmd.exe, cmd.bat, etc) in the current directory, than that cmd executable will be invoked.
I would go with using %comspec%