Discuss Scratch

goldfish678
Scratcher
1000+ posts

Fixing Your Batch Errors

Ever wrote a Batch program that just resulted in an error that only showed for a millisecond, then just closed the entire program?
This is almost impossible to diagnose, so here's a guide on…

Fixing Your Batch Errors!

Note: this isn't necessarily a tutorial on how to FIX them, just a tutorial on how to set up for diagnosing because every time Batch gets an error, it closes immediately.

First you're going to want to open up Command Prompt. To do this, consult the table below:



Then type in:

cd [replace this text including the [] with whatever folder you saved your batch file in]

Note: If your batch file is saved in a multi-folder directory (e.g. C:\Users\SomeRandomUser\Documents\SomeRandomFolder), then just take out the C:\Users\(insert account name here)\ and put it next to
cd
.

Other note: If your batch file is saved in the Desktop, there's a folder for that, too; just type in
cd Desktop
.

Once you press Enter, you're ready to open your Batch file. Just type in (insert name of batch file here).bat, then press Enter. Your batch file should pop up. Now, do whatever you need to do to trigger the error, or just let it run if the error occurred immediately. Since you ran it through Command Prompt, it doesn't close, and you can read the error and diagnose it from there.

Hope I helped!

-goldfish678

EDIT: Please tell me if this belongs in AT.

Last edited by goldfish678 (Aug. 19, 2014 16:39:42)

Zeusking19
Scratcher
500+ posts

Fixing Your Batch Errors

Or, shift-right click in the folder where the bash file is and choose “Open command window here”
goldfish678
Scratcher
1000+ posts

Fixing Your Batch Errors

Zeusking19 wrote:

Or, shift-right click in the folder where the bash file is and choose “Open command window here”
…
PullJosh
Scratcher
1000+ posts

Fixing Your Batch Errors

Or, take a screenshot at just the right moment and paste it into paint.net. That's what I do.

Why do I do everything the hard way?
davidkt
Scratcher
1000+ posts

Fixing Your Batch Errors

Zeusking19 wrote:

Or, shift-right click in the folder where the bash file is and choose “Open command window here”
:O You can do that? I've been needing that for ages!!!

Powered by DjangoBB