preventing command line window from auto closing?

r3lic76

Gawd
Joined
Jan 15, 2001
Messages
878
In windows 2000 or 2003, how do I prevent cmd windows from automatically closing after execution? I need them to stay open to debug an activex script
 
they, uuuummm...do stay open, if you run the command from the actual command line, and not from the "run box".
 
I'm not aware of a way to do that. You could make batch files for the commands.

copy con ipconfig.bat
cmd
ipconfig.exe
^Z
 
a shell window is opened by my ASP script in Internet Explorer but immediately closes without letting me read the error message
 
There are several ways to do it.

The easiest way if you are running batches or .cmds would be to put a pause statement at the end of the script. It will sit there and wait for a keypress.

Since you are calling from an ASP script this may or may not work, but if you can invoke the command interperter with the /k switch it will stay open once it has finished its business. ie
Code:
%SYSTEMROOT%\cmd.exe /k mybatch.bat

If all you need is the output you could also try redirecting from STDOUT to a file ie
Code:
mybatch.bat > %USERPROFILE%\desktop\log.txt

Hopefully one of those will work for ya.
 
Back
Top