New
#1
Using a .bat file to run another .bat file - 2nd .bat file (fails)
Hi,
I am using two .bat files together. The first .bat file runs on a timed scheduled task (something like 3pm daily) and is simply a warning/informational message and then if the user hit's "any key" it will close the window/complete the execution and as a result will call a second .bat file. (if they close the first DOS .bat prompt window the second will not be called) The second .bat file runs a series of backup exercises. Namely mail as well as a single folder on the machine. Here is my issue:
If I manually execute the first .bat file, the 1st dos window opens, I hit any key - the window closes and the second backup .bat file executes beautifully. (I would have mail/files closed) When the first .bat file is called from the scheduled task, i(f the scheduled task opens the first file) and then before hitting 'any key' in the active DOS window, I click out of the prompt to close mail and any open files I have that are included in the backup, THEN activate the DOS window, press return - the second file opens and "runs" but doesn't backup - it acts as it would if I had the outlook mail open (skips the backup).
It seems that if I take focus off the first DOS prompt that pops up to close mail/files then activate it to execute the second .bat file it 'skips' the execution of the second...it'll run it - the second DOS screen pops up and scrolls through the commands but no backup is actually done.
I'm perplexed here! I very much appreciate anyone's thoughts/input on this one. Thank you very much.
John