troubleshooting Question

Batch file in Scheduled Task completes only when user is logged onto server

Avatar of Christian Palacios
Christian PalaciosFlag for Canada asked on
Windows Batch* task schedulerWindows Server 2012
5 Comments2 Solutions314 ViewsLast Modified:
Hi there,

I have a scheduled task with these properties:

User account to run the task: A Service account that has logon as batch file privileges
Run whether user is logged on or not is enabled
Run with highest privileges is enabled
Configured for Windows Server 2012 R2
Trigger: Runs hourly
Actions values:
  • Action: Start a program
  • Program/script: Powershell.exe
  • Arguments: -command "Start-Process  C:\Build.bat -Verb runas"
  • Start in: C:\SDS_IT\

Now the problem I am having is that even though I have set the task to run whether user is logged on or not, it never completes unless the user is actually logged on.  If it I log out, the task starts and it gets to about 95% done and then it just gets stuck.  I've tested this theory several times and this is always the case.  I'm confused as to why it's not working.  The service account has local administrative permissions on this VM too.  I'm using PoweShell because I want the script to run a command prompt as administrator.

Any thoughts????
Thank you in advance!
Steve Knight
IT Consultancy

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros