0
votes

We have a vbs script that runs once a month. The script ran well for the most part but as a couple months ago one command stop working

The vbs script is executed by Windows Scheduler

Inside this script we set a variable called "launch"

Set launch = WScript.CreateObject( "WScript.Shell" )

and later in the program we use this command

launch.run("runthis.BAT")

We do not specify the full path in the command and to my knowledge we never have. This bat file resides in the same directory that the vbs script does. I guess this is why it was setup to run that way.

We are not sure what happened and the sys admins are not sure what could have changed to cause it to no longer work.

Please keep in mind we are not VBS specialists and this is something that has been in place for several years.

Any suggestions or resources to look at would be appreciated.

1

1 Answers

0
votes

In order for us to provide a better answer, please update your question with the script you are having trouble with. We don't know what the launch object is - hopefully something other than WScript.Shell. Nevertheless you should be able to run a batch file this way:

Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "C:\your_folder\your_batch_file.bat"

Replace the launch.run part of your script with this code and update it with the correct path and name of your batch file (update "C:\your_folder\your_batch_file.bat" part).