• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4777
  • Last Modified:

Scheduled Task won't launch .bat or .vbs

I can't get GPO-based Scheduled Task to launch .bat or .vbs on Windows7 client machine.

We have Sever2008 domain controllers - I'm using typical GPO settings (Computer -> Preferences -> Control Panel -> Scheduled Tasks) to set a task to run under "System" authority.  I've tried making it launch .bat and .vbs files, and it won't do either.  These are very basic (helloworld.bat and msgbox.vbs - have been scripting for years).  

After reboot, I go into "Scheduled Tasks" on the client and I see the task.  It kicks off at the appropriate time, and it shows "The task is currently running (0x41301)" - however, it never actually launches the batch file or the script (I've tried a variety of versions - either trying to run a .bat or a .vbs (vbs running under wscript.exe).  I never get the response I expect to see (a popup box showing "Hello World") to indicate that the script/batch file is actually running.

Thanks...DavidS
0
DWStovall
Asked:
DWStovall
  • 5
  • 3
  • 3
  • +1
1 Solution
 
SteveCommented:
So the scheduled task is applied to the PC, it just doesnt work. is that correct?
What location have you specified for the batch file? is it on a server share on on the PCs?
0
 
DWStovallAuthor Commented:
Created a GPO which includes settings (path in previous mesage) to create a Scheduled Task to run under System authority.  RSOP shows that the policy applied, the Task Scheduler Library on the client machine shows the task.  The task is set to run a "hello.bat" from the C:\ root.  The hello.bat is on the client's C:\ root.  The hello.bat runs perfectly (very simple HelloWorld popup) when I launch it manually on the client machine either by double-clicking it in a standard window or launching it as a command line from a prompt - the batch file runs just fine.  The scheduled task (created by the GPO) launches at the prescribed time, the "Status" shows that it is "Running", the history (in the Task Scheduler shows all the expected steps (Task Registered, Task Triggered, Task Started, Action Started, etc), but it never actually runs the script.  I've checked and double checked all the security settings for the batch file, and everything should work.  It's as if there is a Security Policy setting to not launch .bat or .vbs from a Scheduled Tasks.  I've been working on this for days.  My next step is to repair/rebuild the client.
0
 
Donald StewartNetwork AdministratorCommented:
This is because the task is running under the context of "System" and not of the user that's logged in

read here

http://technet.microsoft.com/en-us/library/cc722152.aspx
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
SteveCommented:
ah, yes. you've set it to run as system. this will not interact with the desktop, although I think there may be a setting you can change that will enable desktop interaction.
0
 
DWStovallAuthor Commented:
I disagree...it wasn't a solution.  I had already tried the solution by dstewartjr.  
0
 
Donald StewartNetwork AdministratorCommented:
Having a hard time believing that
0
 
DWStovallAuthor Commented:
I believe this is a result of improper group policy settings.  We've since abandoned the approach.  I am not opposed to awarding the points as suggested, but the solution was not a solution and should not be designated as one - it would be misleading.

I apologize for not responding to the posts.  I will try to be more responsive in the future.

Thank you...
0
 
Donald StewartNetwork AdministratorCommented:
Sorry, but I disagree

"Created a GPO which includes settings (path in previous mesage) to create a Scheduled Task to run under System authority. "


A scheduled task that runs under the "System" context will *Not* be visible to the logged on user. Nothing to do with Group Policy.

My answer was posted on prior experience with this issue.

In fact the only way I've found to get a task to run interactively as another user is to use "AT"

http://support.microsoft.com/kb/313565

0
 
QlemoC++ DeveloperCommented:
The first link provided does not tell us anything about the issue at hand - it is a description of general task properties, and some account restrictions, but nothing regarding interaction with the desktop.

The AT link does not work on Vista and later anymore as described. AT always runs with SYSTEM account, and ignores the "/interactive" switch (SYSTEM cannot interact with the user desktop, as correctly stated).

However, if you start tools like msg.exe for sending popups, that works in all variations, even when called from a batch file.

The only way to get an interactive cmd prompt is by having the job run under the current login credentials, and with the setting "Run only when user is logged on".
0
 
SteveCommented:
There are several reasons we could suggest as the cause:

Improper GPO settings
Issues with WIN7 and interactive 'System' processes
Batchfile errors

Without establishing which, I think it's probably best to delete the question and drop it.
It sucks to participate without getting points for your work but we cannot profess to have provided the solution as the asker dropped the issue without success.
0
 
DWStovallAuthor Commented:
I recommend closing the ticket and starting over.  I will do more research to better determine the condition under which the task was not working.  I will then be able to better document the case and resubmit.  

I apologize for the submitting the question and creating such a mess.

DavidS
0
 
DWStovallAuthor Commented:
It wasn't a complete solution - only pointed in the general direction.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 5
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now