Solved

Windows 7 - Scheduled Task and .VBS file

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

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 53

Expert Comment

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

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

So many times I have seen the words written in a question "if only I could show you" or " I know how hard it is for you since you can't see it" in any zone. That has inspired me to write about this tool in windows 7 called "Problem Steps Recorder…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

920 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

14 Experts available now in Live!

Get 1:1 Help Now