Computing.Net > Forums > Disk Operating System > Create a filename with a timestamp

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Create a filename with a timestamp

Reply to Message Icon

Name: Patrick
Date: December 20, 2002 at 11:28:25 Pacific
OS: 2000
CPU/Ram: P4 2.26GHz/512Mb
Comment:

I would like to create or rename a file in DOS. I need to programmatically change the filename so I thought that having a timestamp as the name would be an easy way to keep track of the file. Is there anyway to create a filename from a timestamp. Or as a workaround, is there a way to read text from a file and then append it to the filename. Thanks




Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: December 20, 2002 at 19:56:02 Pacific
Reply:

For timestamp:

FAQ #04 - Get time into a variable without separators

For reading data from file, use FOR/F:

for /F %%I in (FILENAME.TXT) do echo %%I

To get more information on that command, type "for/?" on the command prompt.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0
Reply to Message Icon

Related Posts

See More


Can not save a path Triple-Talk USB driver fo...



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: Create a filename with a timestamp

Creating a directory with a pop-up www.computing.net/answers/dos/creating-a-directory-with-a-popup-/14130.html

Create a directory in DOS with Mont www.computing.net/answers/dos/create-a-directory-in-dos-with-mont/16838.html

Creating a BATCH script www.computing.net/answers/dos/creating-a-batch-script/163.html