I am using vbscript to run an exe on a remote system. First i connect to the remote system.
Set objSWbemServices = objSWbemLocator.ConnectServer _
(strComputer, "root\cimv2", _
strUser, strPassword)
Then i create a process on the remote system.
Set Process = objSWbemServices.Get("Win32_Process")
result = Process.Create("cmd /C ""cd " & somedir & " && " & "Collector.exe -v", , , intProcessID)
Now this code works fine. However the exe gives some output on the console which i want to redirect to a file on my local system.
I tried the following options
result = Process.Create("cmd &1>abc.txt /C ""cd " & somedir & " && " & "Collector.exe -v", , , intProcessID)
While the above option does not work at all,
or
result = Process.Create("cmd /C ""cd " & somedir & " && " & "Collector.exe -v > abc.txt", , , intProcessID)
this code created the file in the remote system. However i want the file to be created in the local system from where i am running my vbscript. Any help??