Hello @Barry Brierley
It sounds like the issue might be related to permissions or the environment in which the Scheduled Job is running. Here are a few steps you can take to troubleshoot and resolve the issue:
- Run with Highest Privileges: Ensure that the Scheduled Job is set to run with the highest privileges. This can be done by checking the "Run with highest privileges" option in the Task Scheduler.
- Check User Account: Verify that the user account running the Scheduled Job has the necessary permissions to access the Excel file and execute the VB Script. The account should have full control permissions for the folder containing the script and the Excel file.
- Log On As Batch Job: Ensure that the user account has the "Log on as a batch job" permission. This can be configured in the Local Security Policy under Local Policies -> User Rights Assignment.
- Ensure that the Actions TAB in the task scheduler is configured correctly. The action should be to launch wscript.exe and pass your.vbs file as a parameter. Note If the path contains Spaces, use double quotation marks. For example:
Program/script: wscript.exe
Add parameter: "C:\path\with spaces\to\your\script.vbs"
You can try creating a simple batch file (.bat) to invoke your script and schedule the task scheduler to run this batch file.
For example, create a '.bat 'file with the following content:
Copy
@echo off
wscript "C:\path\to\your\script.vbs"
I hope this helps.
If you found it helpful, could you kindly click the “Accept Answer and upvote” on the post.
If you have any further queries, please let us know we are glad to help you.