Link to home
Start Free TrialLog in
Avatar of qwert5905
qwert5905

asked on

Batch file will not work via Scheduled Tasks in Windows 2000

I have a very simple batch file which runs OK when launched manually, however, when I attempt to schedul the batch file to run via Windows 2000 Server Scheduled Tasks utility, the batch file will not get executed. The scheduled task simply states "Could not Run". I have added domain Admin privileges (Full Control) on the batch file and within the task itself. I have also tried using the local Admin account.  The batch file name is StopGhostSrv.bat - The only command line in the batch file is:

net stop "Symantec Ghost Win32 Configuration Server"

Any ideas?
Thanks!

Chris
Avatar of Purple_Tidder
Purple_Tidder
Flag of United States of America image

You need to set up either a new user/pass just for running tasked batch files, or set up your account with a password.  They require a password now, it's a security thing microsoft thought up.  I always just set up a new admin user called taskdude with password runthat.  Then in the task scheduler, you need to set up your batch to run with that user and pass.
On other tasks it doesn't matter, but batch files and scripts require passwords.
Avatar of jdickerson
jdickerson

Save the file as a .cmd, give it a shot, if no good, download autoit from http://www.autoitscript.com/autoit3/, compile the one line into an executable and be done with it. We have had issues with 2000 Server not wanting to run .bats from the task scheduler although they could run successfully manually. Just a couple of quick things to try
Avatar of qwert5905

ASKER

Well, I have another 2000 server which I run a batch file fine, and the task is scheduled with the Domain Admin user id and password, similiar to how I'm trying to setup the StopGhostSrv.bat batch file I mentioned. The only difference is in what the batch files are used for. So, I woud think the Domain Admin user id should be OK to use, as evidence in another Windows 2000 server.

Chris
Hmm... Both of these are identical 2000 servers with the same service packs and hotfixes?  I wouldn't think so.  See, this used to work fine, until microsoft released a hotfix.  Now it requires a password.  But if these are both servers, the account that you are using on both machines to schedule batches to run both have passwords set anyway correct?
I've seen the same behavior qwert, sometimes works OK, sometimes not. We never have enough time to completely nail down why it is so flaky, to many other things to do. Converting it to an .exe will work for sure and then scheduling will work for sure
Thats strange, I've never had a problem, as long as I used a password.  We have 2000 pro and XP machines here, and had a 2000 server before we got our new 2003 sbs.  I haven't had this problem with any of them.  Strange that both of you would.  And same for you jdickerson, 2000 Server as well?
Yep, really weird, some tasks work like gold others not so, ......something to do I think with what task is being done by the batch file but it has been awhile since we have done anything with it, I will have to look at my notes. We just decided to quit fighting it and take the workaround, I am a lover not a fighter :)
I'm sure someone here knows the answer, time to go home for the day, good luck qwert, will help tommorrow if needed
Thanks all for your replies. I changed to .cmd file, which works manually, but not scheduled. I even created a new local account as part of the Admin group, gave full control to file and task, nothing. Tried batch file to StopGhostSrv.exe but manual execution did not work. The 2 Windows 2000 servers are patched differently. This is the damnest thing since I've run batch files various times without any hassles.
Chris
What does your task scheduler log tell you, anything more?
Does 2000 even have a log, I'm not even really sure.
ASKER CERTIFIED SOLUTION
Avatar of r-k
r-k

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ran into this problem even before Windows 2000.  This is a known problem with any NT based system that batch jobs simply doesn't work too well.
You can, however, download any free software (or at least extremely cheap, and they usually comes with 30 day trials) like launchpad or JIT scheduler.
Both of those programs worked fine and resolved my problems.  I am still using those programs to date.
Thanks to everyone for their input. R-K was the closest and worked. I thought my days using the AT command were gone, but this quickly resolved the issue.
Sweet.  Now I know if I ever run into this...

Nice r-k, good job.
Thanks. Here is a link that "explains" this problem:

 http://support.microsoft.com/default.aspx?scid=kb;en-us;223375