Avatar of lloving
lloving

asked on 

Cannot get VBScript to run as schedules task

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.
VB ScriptPowershellWindows Server 2008

Avatar of undefined
Last Comment
Bill Prew
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

This could be a permissions issue, where the account running the script does not have access to either the source or destination folder.
Avatar of Bill Prew
Bill Prew

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
Avatar of lloving
lloving

ASKER

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.
Avatar of lloving
lloving

ASKER

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.
Avatar of Bill Prew
Bill Prew

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
Avatar of lloving
lloving

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of lloving
lloving

ASKER

Ok, I'll report back after testing.
Avatar of lloving
lloving

ASKER

Thanks Bill. That was the key.
Avatar of Bill Prew
Bill Prew

Great, glad that was helpful.

~bp
Windows Server 2008
Windows Server 2008

Windows Server 2008 and Windows Server 2008 R2, based on the Microsoft Vista codebase, is the last 32-bit server operating system released by Microsoft. It has a number of versions, including including Foundation, Standard, Enterprise, Datacenter, Web, HPC Server, Itanium and Storage; new features included server core installation and Hyper-V.

86K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo