inputting data to another file with dos

Associate
Joined
8 Mar 2007
Posts
2,176
Location
between here and there
hey all,


I need a batch file to input certain data to another batch when run.

seems odd i know so let me explain.

i have a prgom that i have written that starts a batch file with 3 following add on's (shell ("c:\batch\mine.bat " + choice + " " + choice1 + " " + box.text)

the proble is that i want to have a stauts bar of the progress of this bacth file but VB won't let me do this with a program or batch that has added on information on the end, there fore i require the 1st batch file to take the inputted date (%1, %2, %3) and autofill in a template so that VB can run the 2nd batch file with the correct data and with no added information on the command line.

any ideas as i'm stumped!!!
 
What I would do is get VB to create a text file with the contents of the second batch file in the chain inside it but replace the %1, %2, %3... with the values you need. Save it as whatever.bat then run that, no need for 2 batch files then. I will post code later on if needs be but need to know if we are talking VB6 or .NET
 
thanks for the reply,

where talking about VB.net, and having slept on it i think i might be easier to get the first batch file to save the choices, %1, %2, %3 as a separate text file and then the 2nd batch files could just call the values from the saved text files.

Same idea as yours, (mainly because i know how to do that, "%1>>c:\temp.txt"

but then i fall short of not knowing how to input that .txt file as a value back in to dos ie, "ping < c:\temp.txt" or something???

we could by pass all of this if VB.net could write the batch file needed with the correct information.

if you could post some code that would be very helpful.

cheers
 
Back
Top Bottom