Solved

Windows 7 - Scheduled Task and .VBS file

Posted on 2014-10-20
5
1,024 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 10

Expert Comment

by:JEaston
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 54

Assisted Solution

by:McKnife
McKnife earned 250 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 250 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 54

Expert Comment

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

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

776 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