Task scheduler simply returns the error code returned by the command it runs. Sometimes programs return non-zero error codes when they have actually done what you wanted. Is this the case? When you run the command from a command line what do you get if you type: ECHO %ERRORLEVEL% immediately afterwards?
"Jen" <jenlbenson[ at ]gmail.com> wrote in message news:1177453961.790799.131200[ at ]t39g2000prd.googlegroups.com...
[Quoted Text] >I have a script that uses logevent. Logged in as my account the > script runs successfully, without errors, and writes to the event > log. When I attempt to run this batch file as a scheduled task, under > my SAME credentials, it fails with 0x1 error, which according to > microsoft means "An incorrect function was called or an unknown > function was called". If I rem out the logevent line the scheduled > task runs successfully. > > The line bombing the scheduled task is: > > c:\winnt\system32\logevent.exe -s I -r "ADExport.bat" -e 0 "ADExport > Started." > > The same line runs from the command line successfully. Everyone has > read/execute perms on the logevent.exe file. > > The box is a domain controller. Any ideas? >
|