I am facing a problem, problem is i need to access machine remotely and then i need to copy certain files from one folder and copy into other folder, i am able to access the machine by following code
strComputer = "Remote machine name@
strDomain = "Domain name"
strCommand = "test.vbs"
uname = "Test1"
pass1 = "password"
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,"root\ci mv2",uname,pass1,"MS_409","ntlmdomain:" + strDomain)
above code is working perfectly and i have sucessfully login into the machine , now i need to run a VBS file in remote machine which i have written code to copy files from one folder to another.
Can anyone Suggest something, highly apperciated.
Thanks in advance.
Try using WScript and CreateObject to execute the script on remote machine
Winds of Change
I tried but unable to do exactly on remote machine .... can u plz give code for the same....
Also i am unable to execute the following code
Dim Controller, RemoteScript
Set Controller = WScript.CreateObject("WSHController")
Set RemoteScript = Controller.CreateScript("test.js", "remoteserver")
WScript.ConnectObject RemoteScript, "remote_"
It's throwing "Object Required : 'WScript'"
need help on this ?
Does scripting.createobject work instead? Or how about just CreateObject("WSHController")?
Try using pstools.