Solved

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

Posted on 2012-03-20
6
464 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
Too many email signature changes to deal with?

Are you constantly being asked to update your organization's email signatures? Do they take up too much of your time? Wouldn't you love to be able to manage all signatures from one central location, easily design them and deploy them quickly to users. Well, you can!

 

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 250 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

Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

Join & Write a Comment

If you migrate a Terminal Server licenses server inside the 2008 server family, you can takte advantage of the build-in migration tool. If you like to migrate an older 2003 Server (and the installed client CALs) to a 2008 R2 server for example, you …
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…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now