Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > MSDOS Programmer > Re: Rename DOS ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 11 Topic 471 of 495
Post > Topic >>

Re: Rename DOS File

by foxidrive <gotcha@[EMAIL PROTECTED] > Nov 2, 2007 at 02:02 AM

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.
 




 11 Posts in Topic:
Rename DOS File
brettmanning24@[EMAIL PRO  2007-10-31 10:20:27 
Re: Rename DOS File
Herbert Kleebauer <kle  2007-10-31 19:09:02 
Re: Rename DOS File
brettmanning24@[EMAIL PRO  2007-10-31 11:20:59 
Re: Rename DOS File
Herbert Kleebauer <kle  2007-10-31 19:47:12 
Re: Rename DOS File
ppnerkDELETETHIS@[EMAIL P  2007-11-01 09:53:48 
Re: Rename DOS File
foxidrive <gotcha@[EMA  2007-11-01 21:56:49 
Re: Rename DOS File
ppnerkDELETETHIS@[EMAIL P  2007-11-01 13:38:30 
Re: Rename DOS File
foxidrive <gotcha@[EMA  2007-11-02 02:02:00 
Re: Rename DOS File
ak621@[EMAIL PROTECTED]   2007-11-01 14:45:25 
Re: Rename DOS File
"Jim Langston"   2007-11-05 23:08:41 
Re: Rename DOS File
foxidrive <gotcha@[EMA  2007-11-06 18:54:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 15:43:57 CDT 2008.