Stopping items in batch files from running

Batch files (.bat) are a set of commands that are sent to the command line. They can include limited flow, and do support variables. Windows XP onwards has slowly improved the function of these files.

 

They can be edited in any text editor (for some history see edlin). If there is a particular command you wish to stop running in a batch file then you can use the command REM at the start of the line which will then cause the operating system to treat whatever appears aftewards as a REMark.

So in the batch file below

@echo off

MD junk

REM DEL *.zip

MOVE*.*  junk

 

the command to delete all zip files (del *.zip) would not run as the REM command in front of it

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s