Solved

Cannot get VBScript to run as schedules task

Posted on 2016-10-17
10
28 Views
Last Modified: 2016-10-19
I cannot seem to get a VBScript to run as scheduled task on Windows Server 2012 R2. From the task properties window I can see that the task runs as scheduled but the script does not appear to execute. The script is supposed to copy folders from the server to a NAS. The task runs but the folders are not copied.
I have tested the script extensively so I know it does what it is supposed to when run from the desktop.

Any suggestions would be appreciated.
0
Comment
Question by:lloving
  • 5
  • 4
10 Comments
 
LVL 26

Expert Comment

by:Shaun Kline
ID: 41846517
This could be a permissions issue, where the account running the script does not have access to either the source or destination folder.
0
 
LVL 51

Expert Comment

by:Bill Prew
ID: 41846565
What options or configuration did you use in the scheduled task setup?

I would also suggest logging some debugging information from the VBS script when it runs to a text file, so that you can better diagnose what executed and what didn't in the script and information that might help you see a problem.

~bp
0
 

Author Comment

by:lloving
ID: 41846888
Thanks for the quick reply.

The account running the scripts and the account scheduling the task are both the System Administrator for the server. The task is running with all privileges.

I will test again with some debugging script but I am pretty sure the script never runs.
0
 

Author Comment

by:lloving
ID: 41848118
I have done some more testing. I put a MsgBox in my script to display at the beginning of the script and one at the end. Neither show up. Looks to me like the script never runs.
0
 
LVL 51

Expert Comment

by:Bill Prew
ID: 41848688
In Task Scheduler, for the scheduled task you created that isn't running, what does the activity log for that specific task show?

Also, can you share some screen shots of the configurations screens for that scheduled task, we might see something that isn't correct or might cause a problem.

~bp
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:lloving
ID: 41848734
i found the problem I think. When the task runs it does not know what program to use to run the script. The extension on the script id .vbs. Should I change it to .cmd or .bat?

Thanks
0
 
LVL 51

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 41848747
I would recommend specifying the program to run it as CSCRIPT.  So make that the executable you run, and then pass it the VBS file name.

~bp
0
 

Author Comment

by:lloving
ID: 41848761
Ok, I'll report back after testing.
0
 

Author Closing Comment

by:lloving
ID: 41850043
Thanks Bill. That was the key.
0
 
LVL 51

Expert Comment

by:Bill Prew
ID: 41850092
Great, glad that was helpful.

~bp
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
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 tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

762 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

22 Experts available now in Live!

Get 1:1 Help Now