views:

631

answers:

5

I'm trying to run a script from the Windows XP console. (In case it's relevant, it's a file of WinSCP commands.) When I type in the command to run the script, another console window pops up for about half a second, then it disappears.

The script isn't working. The error message may be in the console window that popped up. How can I get it to stay long enough to read it?

+1  A: 

use the "pause" command.

ShaneB
+1  A: 

use "pause" as the last line in your script.

Learning
+4  A: 

try staring your script

cmd /k script
RSabet
+1  A: 

You can run the script from command line, so that you can see if there are any echos commands or if there are any errors.

You can see what is happening, in case they have used echo or they have not redirected the information/errors using ">nul 2>&1". In such case remove " >nul 2>&1" from the script.

Techmaddy
+2  A: 

You're looking for the question below. It was asked slightly differently, but the answers given there are the same as for yours.

Is there a way to look at what the windows command prompt just closed?

Rob Kennedy