 |
ExeScript |
 |
How To |
 |
VBS Files |
|
|
Tips for Writing Batch Files
- Use the ECHO command to write text to the
screen.
- Run Windows programs from the command line with the "start"
command.
- Use "command" debug mode to single-step through a Batch
script.
- If you use in a batch file something like if %1 == OK
:, this may crash your batch file because, if
%1 is empty, it will result in a syntax error.
Instead, use if %1. == OK. :
- There is a trick: use :: instead of
REM.
- To echo an empty line on the screen, use
ECHO:
- Instead of using DEFRAG, you can check
individual files or groups of files to see if they are fragmented.
To do so, type in 'CHKDSK filenames', where 'filenames' is a
filename or group of filenames you would like to check. For
example, to check the GAMES directory for fragmentation in *.DAT
files, type in this command. CHKDSK C:\GAMES\*.DAT CHKDSK will give
you a report of each file's non-contiguous blocks. The more
non-contiguous blocks a file has, the more fragmented it is.
See also:
Batch File Examples
Copyright © ScriptCode.com 2010. All rights reserved.
|