Jump to content

Simple DOS batch file works in Windows 8 fails in Vista?


G+_Rud Dog
 Share

Recommended Posts

Ben, running  the batch file causes a DOS prompt window to open and rapidly close after which nothing happens as opposed to Win8 where it launches my python3 script.

So simple yet frustrating.

Does this mean just entering ccs.exe in my batch file will fix the problem for Vista? Gonna have to try that. Then will have to find a way to get the batch file to recognize the OS it is running on. Overly complicated( I know welcome to windows)

BTW I have always wished they had embedded the environment Unix users have enjoyed for years, bash, sed, awk etc.

Link to comment
Share on other sites

Ben, tried the command alone in the batch file and it ran the same route as with the CALL command.

FYI: Also some had said there is a problem with DOS commands related to the registry so I went to the MS site and ran the FIX-ME program they recommended but still the same problem. 

Link to comment
Share on other sites

Interesting that it's opening and closing without any other alerts. You said double clicking the exe runs fine on Vista, how about running it from command line? One way to troubleshoot is to run the bat file from command line as well. That will keep it open and if there's an error being thrown it will be visible instead of disappearing.

 

Is the bat file doing anything else? If not, is there another reason the batch file is being used? Regardless, the same batch code should work on 8 and Vista unless you're doing something else in the batch that's not compatible in Vista.

Link to comment
Share on other sites

Ben, as soon as my duplication of laptop drive completes, its running Vista, will run the batch file from command line and see if it displays an error.

As for is the batch file doing something other then starting the python 3 script, yes it is. This in its self took some research hell you might have been part of it.

You see if you run my script directly from  windows cmd window it fails. So just before firing off my script the batch file  runs chcp 65001 which makes the failure or traceback go away. That was the best solution after searching communities and knowledge bases I could find as a fix.

Don't remember now if I tested the batch file without chcp 65001 as part of the test run. Will do so after the duplicator finishes created a dup drive on Vista machine.

For testing purposed to get around the failure of the batch file I open dos cmd window as Admin  then type in chcp 65001 manually followed by my pythonscript.py. This tells me the cmds word but not from batch file.

But will test as mentioned above.

Link to comment
Share on other sites

Opened DOS prompt window launched batch file and it carried out the CHCP 65001 then returned the prompt no script execution. For grins ran the batch file a second time and it didn't run either of the two line batch file.

The file only has two line:

chcp 65001

CALL CCS.exe

Tried it with :

chcp 65001

CCS.exe

Same thing

tried it with 

CALL e:/dist_CCS/CCS.exe

and nothing.

Link to comment
Share on other sites

That's frustrating! Not sure if this is the issue or not, but have you tried replacing the "e:/dist_CCS/CCS.exe" with "e:\dist_CCS\CCS.exe"? The backslash is standard for Windows command line.

 

Since the "call" keyword isn't necessary, I'd leave that out. Probably doesn't matter, but I know it should work without it.

 

Also in command line (outside of the batch script), try just running "e:\dist_CCS\CCS.exe" (quotes shouldn't be needed). I can't think of any reason it would run on its own (I presume by double clicking in Windows Explorer) but not from command prompt/batch file.

Link to comment
Share on other sites

First test change the forward slashes with back slashes, no difference.

Same test but with CALL removed, no difference.

Also since the CCS.exe is in the same folder as the bat file decided to try

with out path also tried dot CSS.exe to show CWD and then tried and finally tried .\CCS.exe and nothing. These tests were tried from both window gui and CLI.

As for running the cmd with path;  e:\dist_CCS\CSS.exe this works and also so does running CCS.exe from within the  dist_CCS directory. That's how I knew the CCS.exe was not the culprit. Suspected the path as well but could not get it to fail it followed the path and launched the python script. 

Finally decided to see if MicroSoft has anything on this. Submitted a failed batch file waiting to hear back.

Link to comment
Share on other sites

 Share

×
×
  • Create New...