Solved

Windows 7 - Scheduled Task and .VBS file

Posted on 2014-10-20
5
982 Views
Last Modified: 2014-10-28
Hi !

This is a Windows 7 Enterprise 64bit computer.
I have created a basic task that runs a .vbs file every day at 07:00.
The task runs at 07:00 every day, but doesn't execute the .vbs file.
If I manually double click the .vbs file from c:\temp\, there is no problem.

Does anyone know why it doesn't work within scheduled task?

The user for the scheduled task has the rights to run it. The vbs file is located at c:\temp\.
The same vbs file runs everytime the user logs on to this computer. But the customer wants to avoid logging off and on.

Any advice?

Best regards,
Kenneth
0
Comment
Question by:Kenneth Skogstrand
5 Comments
 
LVL 10

Expert Comment

by:JEaston
Comment Utility
I had lots of issues when first setting up a VBS file in a scheduled task.  Unfortunately it was a while ago so I can't recall the exact solution, but we can check a few settings to start.

I use Windows 2008 and therefore the task scheduler is different to that found in older versions.  If your still using Windows 2003 this may not help.

Firstly, in the task properties ensure the task is set to 'Run whether a user is logged on or not' and above this you have specified a user account and password.  In addition the 'Do not store password' should be un-ticked.

On the Actions tab you will probably have a single 'Start a program' action.  Select this then edit to get the action properties.  I am running a script as C:\Admin\Scripts\myScript.vbs.  You should also make sure the 'Start in' option contains the folder, so in my example this is C:\Admin\Scripts

Hope this helps.
0
 
LVL 53

Assisted Solution

by:McKnife
McKnife earned 250 total points
Comment Utility
Task scheduler has some things one needs to be aware of.
-If we start something as a different user, it will not run interactively.
-if the task needs elevation, we need to check the box "run with highest privileges"
-if we need it to run interactively, we have to select "run only when the user is logged on"
-task scheduler has a history tab, which is a log.
0
 

Accepted Solution

by:
Aravind Thangaraj earned 250 total points
Comment Utility
The things you need to check are:

Whether the script is blocked by the AV/other applications.

Whether the script is interacting with the desktop or not. If interacting, choose the task to run only when an user is logged on. Otherwise, remove the interacting events like popup/message box/alerts, as they may waiting for inputs from user, if no user is logged in.

How you are running the .vbs file. By WScript or CScript? Try to start it by CScript application.

If the system is 32 it, access the CSript from %systemroot%/system32/ folder. If the system is 64 it, access it from "%systemroot%/syswow64/" folder.

Check if the .vbs file path contains any space/special characters.

Finally check the log file to get the exact issue and fix it.
0
 

Author Closing Comment

by:Kenneth Skogstrand
Comment Utility
The need for this type of schedule is no longer an issue. We found another solution. I appreciate your comments and feedback.
I irritates me though, that I didn't get this to work. So I am going to test this in my computerlab until I get it to work. I will take your comments and feedback with me. Appreciate it, guys.

best regards,
Kenneth Skogstrand
0
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
Fine. And feel free to come back to this.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After playing around with my ASUS 1215n (http://www.asus.de/product.aspx?P_ID=HrglRhH8D60Rmlv3) Netbook, I finally managed to get smooth HD 1080p (http://en.wikipedia.org/wiki/1080p) playback of videos on it. Second Generation Intel Atom (http://en.…
I found out last night windows update has a problem regarding 4 latest updates that fail.  The way to get all 4 them installed is install sp1 first and restart then one by one with a resart in between as they fail every time if all the four updates …
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…

744 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

16 Experts available now in Live!

Get 1:1 Help Now