Batch File Help

Hello All,

I am not sure where to post this thread. I thought General Computer Chat would work too. If not, Mod please move to the correct location.

I am trying to create a batch file to run the following:

route delete 0.0.0.0 IF 20

I would like to make sure I am doing it right or if there is another step I might be missing.

1. Open Notepad
2. Type in: route delete 0.0.0.0 IF 20
3. Save as filename.bat

Is that all to that to run the above? If that is correct or not please respond so I know what to do. Thank you so much in advance for your responses!
 
Pretty much that's all you need. A batch file is often just a series of commands that you can type into a command prompt. You can do more advanced things like make menus and take parameters if you want, but at it's most basic form, you have all you need.
 
That's basically all you need but there are some things you can do to improve on it if you wanted to.

For instance:

If you do this:

@Echo Off
route delete 0.0.0.0 IF 20

The batch file won't echo the command to the screen before executing it.

If you changed it to this:

@Echo Off
route delete %1 IF 20

and saved it as rtdel.bat then you execute it like this:

rtdel 0.0.0.0 (or whatever IP address you wanted)

There's lots of other stuff you can do to make batch files more useful.
 
Back
Top