Computing.Net > Forums > Disk Operating System > rename file name in todays date.txt

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

rename file name in todays date.txt

Reply to Message Icon

Name: uli_glueck
Date: October 29, 2003 at 01:44:56 Pacific
OS: NT4
CPU/Ram: PII 128MB
Comment:

hi all,
my problem:
I want to change a file name in todays date
like 291003vir_log.txt (NT Dos)

I tried this:
date /t >>date.txt
FOR /f "tokens=2 skip=2 delims= " %%a in ('find "." date.txt') do rename vir_log.txt %%avir_log.txt

But it changes the file name like this: 29.10.2003vir_log.txt

How can I get a correct file name?

thanks in advance for any help
uli



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: October 29, 2003 at 02:44:44 Pacific
Reply:

Use this (derived from your post, but more practical):

For /F "tokens=2-4 delims=. " %%A in ('Date /T') Do Rename Vir_Log.txt %%A%%B%%CVir_Log.txt


0

Response Number 2
Name: uli_glueck
Date: October 29, 2003 at 02:55:55 Pacific
Reply:

Hi Ivo,

it works perfect.
Thanks a lot

uli


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: rename file name in todays date.txt

programming long file names in MS-DOS www.computing.net/answers/dos/programming-long-file-names-in-msdos/10096.html

Long File Names In Dos www.computing.net/answers/dos/long-file-names-in-dos/7110.html

long files name in DOS. www.computing.net/answers/dos/long-files-name-in-dos/3788.html