I can't run .bat and .cmd files with start command (Windows 7)
It sounds like your COMSPEC variable is corrupted. On my Windows 7 machine I have ComSpec=C:\Windows\system32\cmd.exe
. A corrupted COMSPEC value will also prevent pipes from working.
Related videos on Youtube
Juan Antonio Tubío
Updated on September 18, 2022Comments
-
Juan Antonio Tubío over 1 year
I can run .bat and .cmd files typing his names in windows console, but if I run with
start "" file.bat
I get this error:System can't run specified program
.I have tested with a very simple file
test.bat
with this content:echo "hola"
And running:
start "" test.bat
Without success.
If I run just
test.bat
it works perfectly. Also work withcmd /c test.bat
andcmd /k test.bat
. Running .exe files with start command is also working good.Many months ago I had installed ansicon (https://github.com/adoxa/ansicon) and have not problems.
Some days ago I had also installed consolez (https://github.com/cbucher/console/releases) and maybe I have broken something, but I don't know where start to find. I'm testing from cmd.exe command line, not from ConsoleZ.
I can't run a restore point because I have an SSD hard drive and disabled Restore Points.
-
Juan Antonio Tubío almost 9 yearsThanks a lot, it works good. I have looking and default value is:
%SystemRoot%\system32\cmd.exe
.