Solved

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

Posted on 2012-03-20
6
472 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

726 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