Collections:
Other Resources:
What Is "for" Loop Parameter
What Is "for" Loop Parameter?
✍: FYIcenter.com
A "for" loop parameter is a parameter defined in a "for"
command to represent each item from a give list.
A "for" loop parameter must be defined using the "%%name" format, where "name" can be any identifier string.
Same parameter modifiers as batch parameters are also supported on "for" loop parameters as listed below for "%%p":
%%~p - expands %%p removing any surrounding quotes (")
%%~fp - expands %%p to a fully qualified path name
%%~dp - expands %%p to a drive letter only
%%~pp - expands %%p to a path only
%%~np - expands %%p to a file name only
%%~xp - expands %%p to a file extension only
%%~sp - expanded path contains short names only
%%~ap - expands %%p to file attributes
%%~tp - expands %%p to date/time of file
%%~zp - expands %%p to size of file
%%~$PATH:p - searches the directories listed in the PATH
environment variable and expands %%p to the fully
qualified name of the first one found. If the
environment variable name is not defined or the
file is not found by the search, then this
modifier expands to the empty string
You can also apply multiple modifiers together as shown below. The order of modifier locations is not important.
%%~dpp - expands %%p to a drive letter and path only
%%~nxp - expands %%p to a file name and extension only
%%~dp$PATH:p - searches the directories listed in the PATH
environment variable for %%p and expands to the
drive letter and path of the first one found.
%%~ftzap - expands %%p to a DIR like output line
Of course, those modifiers are mostly applicable to "for" loop parameters that represent file names.
⇒ "for" Loop Parameter Modifiers
⇐ Get Batch Parameter as File Path
2022-02-04, ∼2941🔥, 0💬
Popular Posts:
How to start and stop a Windows XP service? If you want to start or stop a Windows service, you can ...
Can I remove startup application "BascsTray.exe - Broadcom Advanced Control Suite" to speedup my com...
What is "SMS Agent Host" in my Windows 7 service list? And how is "SMS Agent Host" service related t...
What is the scheduled task "\Microsoft\Windows\User Profile Service\HiveUploadTask" on my Windows 7 ...
What is shdocvw.dll DLL file - Shell Doc Object and Control Library? DLL shdocvw.dll is the Microsof...