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
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