General RulesNamed parameters are enclosed in percentage signs, as in %name% while input parameters are numeric and use only one percentage sign, as in %1. WAITIn command prompt there is no direct support for timed wait command. However, there is Choice command that has a time parameter that indicates how long it should wait for selection. This can be used for timing. In Windows 7 this can be done in the following way (in this example we wait for 5 seconds):
CHOICE /N /C Y /T 5 /D Y >NUL
DirectoriesCurrent DirectoryChanging DirectoriesUse PUSHD/POPD to switch directories. IF CommandExample of conditional branching:
@ECHO OFF
:TOP
IF (%1)==() GOTO END
ECHO Value is "%1" and still running...
SHIFT
GOTO TOP
:END
See attached if.cmd.txt file for example. Date and TimeSee attached script. Links- Windows XP Command Syntax (link).
- Top 10 DOS Batch Tips (link)
|