Solved

Windows 7 - Scheduled Task and .VBS file

Posted on 2014-10-20
5
1,030 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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.

739 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