1

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.

2 Answers 2

1

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.

1
  • Thanks a lot, it works good. I have looking and default value is: %SystemRoot%\system32\cmd.exe. May 17, 2015 at 8:59
0

To change your COMSPEC environment variable, you can put default value (%SystemRoot%\system32\cmd.exe) with this file.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]  
"ComSpec"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
  74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,63,\
  00,6d,00,64,00,2e,00,65,00,78,00,65,00,00,00

Note: You need to reboot to apply new changes

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .