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 5 of 11 Topic 471 of 500
Post > Topic >>

Re: Rename DOS File

by ppnerkDELETETHIS@[EMAIL PROTECTED] (Phred) Nov 1, 2007 at 09:53 AM

In article <4728CDB0.626E05E0@[EMAIL PROTECTED]
>, Herbert Kleebauer
<klee@[EMAIL PROTECTED]
> wrote:
>brettmanning24@[EMAIL PROTECTED]
 wrote:
>> On 31 Oct, 18:09, Herbert Kleebauer <k...@[EMAIL PROTECTED]
> wrote:
>> > brettmannin...@[EMAIL PROTECTED]
 wrote:
>> >
>> > > Is it possible to use the rename command to rename a *.ITF file
with
>> > > the filename of a TXT file in the same directory.  For example
>> > > Directory 1 contains:
>> >
>> > > DEAL1.ITF
>> > > BRETT.TXT
>> > > DEAL1.LOG
>> >
>> > > Is it possible to rename DEAL1.LOG to BRETT.LOG (the same name of
the
>> > > TXT file).  The TXT file will be a different name each time,
therefore
>> > > it needs to be some kind of variable rename i.e. always rename
>> > > the .LOG file to that of the .TXT filename.
>> >
>> > for %%i in (*.txt) do set n=%%~ni
>> > ren *.log %n%.log
[...]
>The above two lines are for a batch file. If you directly enter
>them in the command line you must only use one %:
>
> for %i in (*.txt) do set n=%~ni
> ren *.log %n%.log
>
>And this only works in W2k/XP not in DOS6/Win9x.

Is that just because the wildcard doesn't work in the for ... do?

Cheers, Phred.

-- 
ppnerkDELETE@[EMAIL PROTECTED]

 




 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 Fri Jul 25 19:55:17 CDT 2008.