'****************************************
Function Remote_Cmd(Server, accnt, pwd, strCmd)
'****************************************
On Error Resume Next
Set Locator = CreateObject("WbemScripting.SWbemLocator"
user = server & "\" & accnt
Set Service = Locator.ConnectServe (Server, "root\cimv2", user, pwd)
Service.Security_.impersonationlevel = 3
Set Process = Service.Get("Win32_Process"
intStatus = Process.Create("cmd /C " & strCmd, null, null, intProcessId)
' response.write err.number & " " & err.description
If err.number <> 0 then
Remote_Cmd = err.number
else
Remote_Cmd = 0
End If
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.