Here's how you can build your own batch files -- or alter those of others

Fred Langa, Contributor

August 5, 2003

2 Min Read

Then you'd insert these lines later in the batch file, perhaps at the very bottom:

copy c:\VIRUS.DAT c:\temp\VIRUS.DAT
del c:\VIRUS.DAT

The "copy" line, of course, copies VIRUS.DAT from C:\ back into into the TEMP directory, and the "del" line then deletes the now-unnecessary copy of VIRUS.DAT in C:\. Thus, those three simple lines would move the VIRUS.DAT file out of harm's way, and back again when it was safe to do so.

So you see, it's easy to modify batch files to work around or adapt to any peculiarities or preferences specific to your system. Piece of cake!

Scratching The Surface
The batch language actually is quite powerful for performing file- and system-level maintenance and diagnostic work; having some basic familiarity with batch operations will make the DOS toolkit you assembled (in previous installments of this series) all the more powerful and useful.

In fact, for all its simplicity, batch files can be quite awesome, and if you'd like to dig further into this technology, here are some of the best links I know:

In the final chapter in this DOS-tool saga, we'll present you with hundreds of reader-submitted batch files, and you may be surprised at how complex and powerful some of them are. But meanwhile, what batch programming tips and tricks can you share? To what unusual purposes have you created or modified a batch file?

Join in the Discussion!

Click for the batch files

To discuss this column with other readers, please visit Fred Langa's forum on the Listening Post.

To find out more about Fred Langa, please visit his page on the Listening Post.

About the Author(s)

Never Miss a Beat: Get a snapshot of the issues affecting the IT industry straight to your inbox.

You May Also Like


More Insights