I am running a long running batch file. I now realize that I have to add some more commands at the end of the batch file (no changes to exisiting content, just some extra commands). Is it possible to do this, given that most batch files are read incrementally and executed one by one? Or does the system read the entire contents of the file and then runs the job?
A:
Could you create a VB script that waits for the first batch to finish, and then fires up a second batch with the extra commands?
ChristianLinnell
2009-05-25 12:47:14
I want to edit the same batch file. Its currently in execution. I cannot plug it into another application.
Ritesh M Nayak
2009-05-25 12:49:52
+4
A:
I just tried it, and against my intuition, it picked up the new commands at the end (on Windows XP)
I created a batch file containing
echo Hello
pause
echo world
I ran the file, and while it was paused, added
echo Salute
Saved it and pressed enter to contine the pause, all three prompts were echoed to the console.
So, go for it!
Binary Worrier
2009-05-25 12:54:48
+1
A:
The command interpreter remembers the line position it's at in the batch file. As long as you modify the batch file after the current executing line position you'll be fine.
If you modify it before then it will start doing strange things (repeating commands etc..).
rein
2009-05-25 12:57:30