Computing.Net > Forums > Disk Operating System > dos batch variable name

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.

dos batch variable name

Reply to Message Icon

Name: Robyn O
Date: September 30, 2001 at 08:46:17 Pacific
Comment:

I am trying to script a program to write to a file with a variable name(AAmmddyy.dat). How can I use a .bat file to write to a variable file name, I can't find anything specific and I am so DOS rusty.



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: September 30, 2001 at 19:04:54 Pacific
Reply:

You mean getting the variable value and using it to name the file?

ren whatever.wtv %variable*

or, if the variable doesn't contain the extention:

ren whatever.wtv %variable%.abc

-- Secret_Doom --

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


0

Response Number 2
Name: Laurence
Date: October 8, 2001 at 23:42:35 Pacific
Reply:

Batfiles: The DOS batch file programming handbook

Use,

ECHO text>%AAmmddyy.dat%

TYPE filename>%AAmmddyy.dat%

COPY filename %AAmmddyy.dat%


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: dos batch variable name

Dos batch file www.computing.net/answers/dos/dos-batch-file/8191.html

DOS Batch - Accepting User input to system Variable www.computing.net/answers/dos/dos-batch-accepting-user-input-to-system-variable/658.html

Dos batch scripting www.computing.net/answers/dos/dos-batch-scripting/11369.html