I can't run .bat and .cmd files with start command (Windows 7)

5,378

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.

Share:
5,378

Related videos on Youtube

Juan Antonio Tubío
Author by

Juan Antonio Tubío

Updated on September 18, 2022

Comments

  • Juan Antonio Tubío
    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 with cmd /c test.bat and cmd /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
    Juan Antonio Tubío almost 9 years
    Thanks a lot, it works good. I have looking and default value is: %SystemRoot%\system32\cmd.exe.