VBS auf Remote PC ausführen
Hallo, ich habe ein Netzwerk wo ich von meinem PC aus ein VBS auf einem anderen Rechner im Netzwerk ausführen möchte, wie kann ich das am besten bewerkstelligen, hintergrund ist das ich via des VBS den Gatway sowie die IP ändern möchte. Das VBS soll über eine VB.Net die ich schon habe via Button aufgerufen werden, lokal funzt es aber nicht auf dem anderem PC im Netz.
Vielen Dank im Voraus.
MfG
MacSero
Vielen Dank im Voraus.
MfG
MacSero
Please also mark the comments that contributed to the solution of the article
Content-Key: 96731
Url: https://administrator.de/contentid/96731
Printed on: April 19, 2024 at 22:04 o'clock
8 Comments
Latest comment
Hallo MacSero!
Mit Angabe eines Admin-Kontos (zB Dein User "MyPC") könnte das (ungetestet) etwa so aussehen:
Grüße
bastla
Mit Angabe eines Admin-Kontos (zB Dein User "MyPC") könnte das (ungetestet) etwa so aussehen:
Const WbemAuthenticationLevelPktPrivacy = 6
strComputer = "Heidi-pc"
strNamespace = “root\cimv2”
strUser = "MyPC"
strPassword = "gehheim"
'oder: strPassword = InputBox("Bitte das Passwort für " & strUser & " eingeben:", "Passwort?")
Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objwbemLocator.ConnectServer _
(strComputer, strNamespace, strUser, strPassword)
objWMIService.Security_.authenticationLevel = WbemAuthenticationLevelPktPrivacy
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
bastla