LuckyDuck528
Programmer
Please advise if this is the wrong place to post my question...
I have a file called WebPub.vbs sitting on a Win2003 Server that I would like to be able to execute on the server from my desktop using WinXP Pro. So far, the only part I have had any success with is mapping and disconnecting the drive. I can't seem to figure out the proper way to write the middle section (seen in red) to actually access the drive I mapped, change dir, and then run the file. Is this possible?
Thank you in advanced for your time and help!![[smile] [smile] [smile]](/data/assets/smilies/smile.gif)
Here is my current code:
I have a file called WebPub.vbs sitting on a Win2003 Server that I would like to be able to execute on the server from my desktop using WinXP Pro. So far, the only part I have had any success with is mapping and disconnecting the drive. I can't seem to figure out the proper way to write the middle section (seen in red) to actually access the drive I mapped, change dir, and then run the file. Is this possible?
Thank you in advanced for your time and help!
![[smile] [smile] [smile]](/data/assets/smilies/smile.gif)
Here is my current code:
Code:
Option Explicit
Dim arrServers, inta, objFile, objFolder
Dim objFSO, objWS, strRunMe1, objNet, strRunMe
arrServers = Array ("JHWSDV13")
'***********************************************************
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWS = WScript.CreateObject("WScript.Shell")
Set objNet = CreateObject("WScript.Network")
'***********************************************************
For inta = LBound(arrServers) To UBound(arrServers)
objNet.MapNetworkDrive "H:", "\\" & arrServers(inta) & "\C$"
[COLOR=red]
objWS.Run "cmd /c net use [H: \\JHWSDV13\C$[\sysapps\batch] [W1n5t0n] ] % z: & cd C:\sysapps\batch\WebPub.vbs JHWSDV13"
[/color]
objNet.RemoveNetworkDrive "H:"
Next