?
Solved

Task Scheduler won't run batch files (2008 Server)

Posted on 2012-03-20
6
Medium Priority
?
492 Views
Last Modified: 2012-04-05
Hi Experts,

I have half a dozen tasks that call batch files set up on a Windows 2008 server, and whilst the task claims to have run, the batch files are not invoked. I've checked the permissions and the shares are available to all. The only way they'll run is with an admin account permanently logged into the server, but even that's flaky! I've set the tasks to run by the NETWORK SERVICE, but still this won't work.

If I create a task on my PC (WinXP) to call the batch file on the server, it works perfectly.

Any suggestions welcome.

Thanks,

Dave
0
Comment
Question by:MrDavidThorn
6 Comments
 
LVL 8

Expert Comment

by:bright12
ID: 37742848
You can create a scheduled task with the option 'Run as Admin' and give the admin username and password. If the scheduler run the program it will run it as an Admin.

I think that this will help you to solve the problem.
0
 
LVL 6

Expert Comment

by:NikolasG
ID: 37742900
Generally when trying to run batch files that require network access on 2008 server be sure to  complete the run as with a user that has access to the network shares that you need.
An other thing to try is to check run only if logged on check box but then you ll have to have an account logged on the server in order for the batch files to run.

Hope it helps.
0
 

Author Comment

by:MrDavidThorn
ID: 37742932
On Server 2008 there is the option to 'Run with highest privileges' which doesn't make a difference.

Interestingly, if I double click the batch file it runs, but if I right click and select 'Run as administrator' it doesn't run and appears to do the same as the task.
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 

Author Comment

by:MrDavidThorn
ID: 37742975
All the accounts I've tried have full control over the share and folders beneath, which contain the batch files. I get an error if I try and create a task without storing the password.

Is there not a way to run it as the local or network service?

Thanks
0
 
LVL 6

Accepted Solution

by:
NikolasG earned 1000 total points
ID: 37745953
Does your bat file have arguments enclosed in quotation marks?
There is a know problem about that in win 2008
http://support.microsoft.com/kb/951246
Other than that it should run normally.
Can you try to take out the quotations from your expressions in the bat file?
0
 
LVL 5

Expert Comment

by:CarlosDominguez
ID: 37746513
My recommendation is to try to call "cmd /c batchfile" in the task scheduler, instead of just calling the batch file.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question