On Thu, 01 Nov 2007 13:38:30 GMT, ppnerkDELETETHIS@[EMAIL PROTECTED]
(Phred) wrote:
>>The %%~ni construct does not work in DOS6/Win9x
> FOR %a in (*.txt) do PRINT %a
That should work, but you may need to use the start command with the /wait
option so multiple print jobs aren't spawned immediately.
>But, now that I've had my dinner and three glasses of a nice red, I
>note that I previously missed the implications of that "set n=%%~ni"
>and, even with the clarity of alcohol-inspired thought processes, I'm
>damned if I can see what that achieves anyway! 8-)
>
>Please feel free to enlighten me. I will be very interested to know
>what that bit does.
Phred, under Windows XP the help has this to say:
===[screen capture]===
In addition, substitution of FOR variable references has been enhanced.
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
The modifiers can be combined to get compound results:
===[screen capture]===
So %%~na resolves to the filename ****tion of the variable, excluding the
extension.


|