05-28-2012 01:09 PM
I am rying to run a batch file from Norton Ghost to create a taks with Task Scheduler in Windows 7. The batch file is one line long:
schtasks /create /f /tn ghostlogproc /tr d:\systemadmin\cmd\testfile.bat /np /sc once /st 16:10
If I run the batch file from the command line, it executes with no problem. As soon as I try to run it as a command file in any ghost backup phase, I get the error message. BTW, the start time is well into the future, so I'm not getting a message that the start time is in the past.
Here is the error message from the Windows application log file:
Error EC8F17B7: Cannot create recovery points for job: test. Error EC8F0401: The command file (before data capture) failed to execute. Error E0BB009C: External command "D:\SystemAdmin\Cmd\testfile.bat" returned an error. Error EBAB03F1: Incorrect function. (UMI:V-281-3215-6071) Details: Source: Norton Ghost
What does 'incorrect function' mean in this context, or how can I find out what Ghost is really complaining about?
05-28-2012 01:26 PM
I'm not positive but I think the problem is that your trying to run a batch file from another batch file.
Even though it may work when you do it from your user account, it's going to behave differently from a scheduled command file run from a program (ghost).
Try adding the "Call" command to run the second batch file.
schtasks /create /f /tn ghostlogproc /tr CALL "d:\systemadmin\cmd\testfile.bat" /np /sc once /st 16:10
Notice I added Call and then put the batch file path in quotes.
I don't know if those switches after the bat file will work if they pertain to an action of the batch file.
Option 2 would be to try to create a single batch or command file that will do everything.
I recall having similar problems before when I would make one that would work fine when I double clicked it but had problems when another program of the task scheduler tried to run it.
Best of luck,
05-28-2012 02:32 PM - edited 05-28-2012 02:35 PM
Sorry, I can see now how that may not work. testfile.bat is the task to run and I don't see how to pass that back to the first command box.
But I think thats exactly the problem you had from the start. The first batch file opens one instance of cmd.exe and the second batch file you are running or calling is opening a second instance of cmd.exe
Is that the behavior you saw originally, you ended up with 2 open command boxes verses only one box when you manually opened cmd.exe and then tested your entire command?
Is there a reason why you can't just add the contents of testfile.bat to your first command file?
I'm guessing you made it that way because it changes?
Edit- What exactly are you trying to do?
Since your creating a scheduled task only to run it once, couldn't it be done an easier way?
05-28-2012 04:45 PM
thanks for your reply. I only get one command window when I run the batch job manually.
What I'm trying to do is run some post processing after the backup has completely finished and all of the log messages have been posted. My job needs to parse the messages and take action accordingly. I've found so far that if I execute a command file in the 'Run after recovery point creation' stage, ghost waits until my command file has finished before going on to the last steps and writing to the log file. I figured a way to let ghost finish first was to set up the job in schedler with a delay that would allow Ghost to finish its processing. I can run the batch job successfully from other programs (such as perl), but as soon as I put it into Ghost, it fails. I'm starting to think it's something about the schtasks command that Ghost doesn't like, but the error isn't providing any clues.
05-31-2012 10:11 AM - edited 05-31-2012 10:11 AM
Are your CMD \ BAT files located locally and not on a network, such as a mapped drive?