Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Windows 7 - Scheduled Task and .VBS file

Posted on 2014-10-20
5
Medium Priority
?
1,035 Views
Last Modified: 2017-01-27
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 11

Expert Comment

by:John Easton
ID: 40391863
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 57

Assisted Solution

by:McKnife
McKnife earned 750 total points
ID: 40391867
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 750 total points
ID: 40398737
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
ID: 40409314
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 57

Expert Comment

by:McKnife
ID: 40409318
Fine. And feel free to come back to this.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Suggested Courses

783 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