Tech Tips / Windows NT / Tools and Tasks
You can use the Windows NT command shell's FOR command for numerous repetitive tasks, from creating a directory on every one of your Windows NT servers to simple housekeeping. Let's look at a fairly simple application of the FOR command's text-parsing capability to perform some administrative tasks. To use FOR to parse text, use the syntax:
FOR /F "tokens=T delims=D eol=E" %I in (Input File) do Command
The /F switch puts FOR in text-parsing mode. T is the token(s) that you want to read from each line of text. D is the delimiter used to separate tokens. E is the character used to mark the end of a line of text. The Input File is the name of the file that FOR parses, and Command is the command that FOR iterates. Seem complicated? You'll be typing FOR commands blindfolded before you know it, but for now you can learn best by example.
Pass your MCSE certification exams with EasyCert - the most realistic exam simulations available today! Click the links bellow for free MCSE demos.
If you're an experienced IT professional and would like to share your expertise with other Setup32.com readers, why not submit a new tip to our Tech Tips area?
Sponsored Links
Microsoft Word :: Web Site Development Forums :: C++ STL Documentation