Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execuing VB Script with Windows Task Scheduler 1

Status
Not open for further replies.

reidacus

Programmer
Mar 4, 2013
2
GB
Hi All

I have created a a small VB Script for some windows 2008 servers which extracts data regarding the free space on each drive in that particular server. These results are all then written to a central .csv file, ready to be inserted into an SQL database. The problem I have, is that when the script is run manually, it works fine and the results file is populated with data from the relevant server. When i attach the script to a scheduled task, although task manager reports that the task executed successfully, nothing is written to the .CSV file. I haven't got two servers writing to the file at the same time as I have tested each server individually and the file is not open on the central server. The scheduled task is set to run as NT AUTHORITY\SYSTEM so that it can run when the server is logged off. Has anyone experienced this before? Is there perhaps another set of credentials I can use to run the task as, if that is the problem? Many Thanks!
 
I know others have run into issues similar to this and discussed them on this forum; a search may help. Personally, I've never had the need to run a vbs as a scheduled task so my experience in the matter is quite limited. However, I do know that if a task is created to execute a script, it must be executed from wscript or cscript. Modify your command to execute one of the hosts and pass the script name as an optional argument.

-Geates

 
Thanks for your response. I've decided to ditch the .CSV file altogether now and I'm writing the data directly into the database. Seems to be working well so far as I was just going round in circles with the .CSV file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top