|Some more syntax beyond the basic "FOR %%i in (set) do ..." |
<<You can now use the following optional syntax:
%~i - expands %i removing any surrounding quotes (")
%~fi - expands %i to a fully qualified path name
%~di - expands %i to a drive letter only
%~pi - expands %i to a path only
%~ni - expands %i to a file name only
%~xi - expands %i to a file extension only
%~si - expanded path contains short names only
%~ai - expands %i to file attributes of file
%~ti - expands %i to date/time of file
%~zi - expands %i to size of file
%~$PATH:i - searches the directories listed in the PATH environment variable and expands %i 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>>
Extracted from http://www.robvanderwoude.com/ntfor... where you can see the complete For command reference.>>
A good command reference tutorial (the better I know) can the accessed in your own computer by typing:
%windir%\hh.exe ms-its:%windir% help\ntcmds.chm::/ntcmds.htm
(tested in Win XP)
I believe many people dont know this.
I also use hh.exe to open folders by a command: hh %temp%\my-tests (its usefull to me in checking results when I am testing some script that deal with files in diferent folders).
For better use put hh.exe into your %path%.