Ethan
Ethan

Reputation: 60099

How can I get a Windows console to stay open?

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?

Upvotes: 1

Views: 2870

Answers (5)

Rob Kennedy
Rob Kennedy

Reputation: 163247

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?

Upvotes: 2

Techmaddy
Techmaddy

Reputation: 4636

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.

Upvotes: 1

RSabet
RSabet

Reputation: 6160

try staring your script

cmd /k script

Upvotes: 4

Learning
Learning

Reputation: 8175

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

Upvotes: 1

LizB
LizB

Reputation: 2213

use the "pause" command.

Upvotes: 1

Related Questions