• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

DOS help: Feeding the result of an operation as a batch file parameter

alexruiz

Platinum Member
The title should give you an idea of what I need to do:

This is DOS, I have 2 batch files and the result of one of them should be the input of batch file #2. Batch file #1 is just performing a DIR with an specific extension and parameter /b. The output will be juts one filename with extension. Batch file #2 needs that filename to perform a ghost restore.

batch 1: dir *.gho /b
batch 2: ...... GHOST.EXE -clone,MODE=prestore,SRC=%1:1,DST=1:1

I already tried a lot of combinations of redirection without success.
batch 1 | batch 2, batch 2 < batch 1, etc

I could just hardcode the filename into batch #2, but it will not be the same in all cases, so the batch file needs to learn it. I could make batch #1 display filename to restore, and display instruction to user to type "batch #2 filename". However, I want to minimize user intervention.

I am thinking that because the %1 parameter works only with direct key inputs after the batch file, maybe that is not the way. Should I use an environment variable? If, so, which variable and how would you do it?

Help is appreciated 🙂



Alex
 
Back
Top