Hey, I am trying to run a .bat file in a script. I got that part but now it gets a tad more involved. is what I would like to do is have a .vbs file sitting on a drive lets call it the O drive. I would like this script to run either a .bat or .exe file on another drive lets call it the D drive. The following is the code I have.
Option Explicit
Dim strDriveLetter, strRemotePath, strNewName
Dim objNetwork, objShell
Dim CheckDrive, AlreadyConnected, intDrive
strDriveLetter = "D:"
strRemotePath = "\\SERVER\folder1\folder2"
strNewName = "Server_name"
dim shell
set shell=createobject("wscript.shell")
shell.run "strDriveLetter.strRemotePath.test.bat"
set shell=nothing
When i run the script I get the message cannot find the file specified. the file is in the correct folder. I did try to google for a solution to no avail. Any ideas would be very appreciated.
Cretin
Option Explicit
Dim strDriveLetter, strRemotePath, strNewName
Dim objNetwork, objShell
Dim CheckDrive, AlreadyConnected, intDrive
strDriveLetter = "D:"
strRemotePath = "\\SERVER\folder1\folder2"
strNewName = "Server_name"
dim shell
set shell=createobject("wscript.shell")
shell.run "strDriveLetter.strRemotePath.test.bat"
set shell=nothing
When i run the script I get the message cannot find the file specified. the file is in the correct folder. I did try to google for a solution to no avail. Any ideas would be very appreciated.
Cretin