VBS to start a process on remote desktops
I'm looking for a script that logs into a remote desktop using proper user credentials and start a process, say notepad.exe.
I googled around and found the following script:
Code:
strComputer = "webserver"
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
Error = objWMIService.Create("notepad.exe", null, null, intProcessID)
If Error = 0 Then
Wscript.Echo "Notepad was started with a process ID of " _
& intProcessID & "."
Else
Wscript.Echo "Notepad could not be started due to error " & _
Error & "."
End If
The problem is, I need to incorporate the username and password somehow to log into "webserver" in the code in order to even use GetObject method. Any ideas?
Thanks in advance! :)