Solved

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

Posted on 2012-03-20
6
471 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

730 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