DOS command to expand environment variables

Microsoft Windows xp professional w/serv...
March 15, 2010 at 11:38:16
Specs: Windows XP
I have a configuration file with place holders for certain environment variables. I want to copy this file by replacing the actual values of the environment variables.

For Instance, I have a temp.ini with

LOCATION=%USERPROFILE%/BACKUP.INI

Now, I want to copy temp.ini into app.ini with the actual value of %USERPROFILE%. (Note: My temp.ini is quite large and has close to 150 lines. )

Is there a way to do it from a command line or inside a batch script?


See More: DOS command to expand environment variables

Report •

#1
March 15, 2010 at 11:57:46
DOS as in Disk Operating System? No.

CMD as in Command Prompt? Yes.


Report •

#2
March 15, 2010 at 12:17:44

Yes, I am looking for the MS-DOS command that would help me do this.

Many thanks in advance.


Report •

#3
June 3, 2010 at 09:43:18
I'm not quite sure whether i correctly understood your problem.

But if, what you want to do, is making a copy of your BACKUP.INI file while changing a single line "on the fly", then the dos utility FAM (find and modify) which i wrote could be useful to you.

You will find this utility in the zip archive DOSUTILS.ZIP which can be downloaded from here: http://www.bttr-software.de/products/jhoffmann/. The file DOSUTILS.TXT enclosed in the same archive will tell you the details.


Report •
Related Solutions


Ask Question