Search code examples
dos

DOS start command not recognising script


I've just recently started having this weird problem.

I've a script which starts up a Jboss service in another window which uses the dos start command.

The line is

start "Jboss" /min server.bat

The script had been working fine, but for some reason has stopped working at this line. If I open cmd window, cd to the directory where the script is, and run it manually I get the same error :-

The system cannot execute the specified program

The server.bat file is in the folder I'm running from. I've even tried creating a simple 'hello.bat' file which just echos out 'Hello' and even this doesn't work.

My Path env setting is :-

%SystemRoot%\system32\;%SystemRoot%\;%SystemRoot%\System32\Wbem\;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\Oracle11gR2\product\11.2.0\dbhome_1\bin;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\

This all used to work until today. I'm not aware of any Window updates, nor have I restarted my PC (until today to see that fixed the problem !)

Running on Windows 7


Solution

  • Managed to resolve this. It looks like some of the system32 files may have been corrupted.

    Deduced this by running the start hello.bat command from the cmd prompt and then outputting the value of ERRORLEVEL

    echo %ERRORLEVEL%
    

    This gave the result '9020'. Searching about on the web there is not a whole amount of information on this, but the bits I could find indicated a broken file system.

    So I found a suitable system restore point, reverted back to it, and this has fixed the problem.

    There was no obvious reason why this had gone wrong, just one of those things.