Here are the three command lines using this syntax.
for /F ["usebackqParsingKeywords???] {%% | %}Variable in ("FileNameSet???)
do Command [CommandLineOptions]
for /F ["usebackqParsingKeywords???] {%% | %}Variable in
('LiteralString??™) do Command [CommandLineOptions]
for /F ["usebackqParsingKeywords???] {%% | %}Variable in ('Command??™) do
Command [CommandLineOptions]
Using Variable Substitution
Variable substitution is the act of exchanging a variable name for the content of that variable. However,
unlike expansion, you don??™t necessarily use all of the variable content. For example, instead
of using the entire path for a file, you might just use the drive letter, the path, or the filename. The
following list describes the basic forms of variable substitution available with the For command.
(The list assumes that you??™re using a variable named I, which translates into %I at the command line.)
%~I Removes any surrounding quotation marks from the variable content.
%~fI Expands %I to a fully qualified pathname.
142 CHAPTER 5 CREATING CMD AND BAT FILES
%~dI Expands %I to a drive letter only.
%~pI Expands %I to a path only.
%~nI Expands %I to a filename only.
Pages:
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384