Computing.Net > Forums > Programming > DOS variables

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 variables

Reply to Message Icon

Name: micc
Date: August 22, 2005 at 02:05:00 Pacific
OS: XP
CPU/Ram: ???
Comment:

I want to create a batch file that reads the output from one command and uses this value as a parameter in a subsequent command in the same batch file.

I cannot figure out how to use parameters in the batch file. I am running the batch file in a command prompt window in Windows XP.

In case this is a bit too cryptic, here is a longer explanation of what I'm trying to do...

I am using a code management system to label a software project at a release milestone. In order to automatically restore the project later on, I need to use the version ID at the point when the project was originally labelled.

So, when I label the project, I need to additionally retrieve the version ID. I want to use this ID in a new command which I will use if I ever need to restore the labelled software, i.e.

............................................
versionid project > $id
versionlabel -c:"LABELXYZ" project
echo restore -v:$id project >> restore.bat
............................................



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: August 22, 2005 at 05:24:10 Pacific
Reply:

I do not fuly understand the meaning of your commands, but if "Versionid project" displays the id version then the following may fit your need

Set /P ProjectId=<versionid project
versionlabel -c:"LABELXYZ" project
Echo Restore -v:%ProjectId% project >> Restore.bat


0

Response Number 2
Name: micc
Date: August 24, 2005 at 04:27:04 Pacific
Reply:

IVO,
Thanks for taking the time to help me.

Yes, "Versionid project" displays the id version.

However, when I try to execute the command

Set /P ProjectId=<versionid project

I get the following error message :-

"The system cannot find the file specified."

I think the solution will be something like this though.............Martin


0

Response Number 3
Name: IVO
Date: August 24, 2005 at 12:15:23 Pacific
Reply:

Sorry, I put you toward the wrong road, now replace my previous post

Set /P ProjectId=<versionid project
versionlabel -c:"LABELXYZ" project
Echo Restore -v:%ProjectId% project >> Restore.bat

with

Versionid project> VerProId
Set /P ProjectId=<VerProId
Del VerProId
versionlabel -c:"LABELXYZ" project
Echo Restore -v:%ProjectId% project >> Restore.bat

where VerProId is a temporary file to hold the project identifier. That should work fine.


0

Response Number 4
Name: micc
Date: August 25, 2005 at 01:48:39 Pacific
Reply:

IVO,
that works, thanks very much for your help.........Martin


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 Programming Forum Home


Sponsored links

Ads by Google


Results for: DOS variables

Create DOS variable - VBS www.computing.net/answers/programming/create-dos-variable-vbs/16905.html

DOS variables www.computing.net/answers/programming/dos-variables/13720.html

DOS variables batch file www.computing.net/answers/programming/dos-variables-batch-file/10346.html