Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'CreateRemoteProcess.vbs
- 'Starts a program on a remote computer using WMI.
- 'Programs started on remote computers are invisible on that computer unlike programs started locally
- ComputerName = "127.0.0.1"
- Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
- Set objProcess = objWMIService.Get("Win32_Process")
- intReturn = objProcess.Create("c:\windows\notepad", Null, objConfig, intProcessID)
- If intReturn = 0 then
- wscript.echo "PID is " & intProcessID
- Else
- Msg = "Error code " & intReturn & vbcrlf & vbcrlf
- Msg = Msg & "2 Access denied" & vbcrlf
- Msg = Msg & "3 Insufficient privilege" & vbcrlf
- Msg = Msg & "8 Unknown failure" & vbcrlf
- Msg = Msg & "9 Path not found" & vbcrlf
- Msg = Msg & "21 Invalid parameter"
- wscript.echo Msg
- End If
Advertisement
Add Comment
Please, Sign In to add comment