Background: I'm using a public computer running windows 7. I don't have permissions to access to the command line (nor the control panel, nor most of C drive). So, I've written the commands I need to execute as a batch program and saved it in a file called "run.bat" onto the Desktop. I run the program by double-clicking the batch file's icon. Something goes wrong, but I can't see what the problem is since as soon at the error comes up the command line disappears. This happens extremely quickly, so I can't even take a scree开发者_JAVA技巧n shot to see the error message.
I've encountered this problem before with batch programs crashing and then disappearing. Is there a way to keep the command line up after an error occurs?
Add the command 'pause' as the last line in the batch file. If you want to get fancy, only execute that line if you detect an error (in whatever you're doing in the batch file).
精彩评论