Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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
............................................

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

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

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.batwith
Versionid project> VerProId
Set /P ProjectId=<VerProId
Del VerProId
versionlabel -c:"LABELXYZ" project
Echo Restore -v:%ProjectId% project >> Restore.batwhere VerProId is a temporary file to hold the project identifier. That should work fine.

![]() |
![]() |
![]() |

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