Option Explicit CONST TARGET_COMPUTER = "Computer2" CONST TARGET_COMPUTER_USERID = "Computer2\Administrator" CONST TARGET_COMPUTER_PASSWORD = "" CONST COMMAND_LINE = "c:\wsname.exe /N:Computer1 /REBOOT" Dim wbemLocator, wbemNameSpace, wbemProcess, wbemObjectSet, intProcessID, intReturnCode Set wbemLocator = CreateObject("WbemScripting.SWbemLocator") Set wbemNameSpace = wbemLocator.ConnectServer(TARGET_COMPUTER, "root\cimv2", TARGET_COMPUTER_USERID, TARGET_COMPUTER_PASSWORD) Set wbemProcess = wbemNameSpace.Get("Win32_Process") Set wbemObjectSet = wbemNameSpace.InstancesOf("Win32_Process") intReturnCode = wbemProcess.Create(COMMAND_LINE, Null, Null, intProcessID) If intReturnCode = 0 Then Wscript.Echo "Command was started with a process ID of " & intProcessID & "." Else Select Case intReturnCode Case 1 Wscript.Echo "Error: The request is not supported" Case 2 Wscript.Echo "Error: The user did not have the necessary access" Case 3 Wscript.Echo "Error: The service cannot be stopped because other services that are running are dependent on it" Case 8 Wscript.Echo "Error: Interactive Process" Case 9 Wscript.Echo "Error: The directory path to the service executable file was not found" Case 21 Wscript.Echo "Error: Invalid parameters have been passed to the service" Case Else Wscript.Echo "Error: Command could not be started due to error " & intReturnCode End Select End If Set wbemLocator = Nothing Set wbemNameSpace = Nothing Set wbemProcess = Nothing Set wbemObjectSet = Nothing