Hi Leute,
das Script lief schon mal super allerdings musste ich mich immer anmelden, das soll das Script direkt intern machen.
Allerdings läuft seitdem ich von Local Anmeldung auf Domain Anmeldung umgestellt habe das Script nicht los. (Bis zum Schritt Geräte Manager klappt es, dieser geht auch mit den richtigen Rechten auf)
Danach sollte das Script mit WinWait eigentlich erkennen, Oh das ist ja ein Geräte-Manager fang ich mal an, macht es aber nicht.
Könnt ihr mal bitte gucken warum es so Stur ist und nicht loslegen will?
Vielen Dank.
Code
$Username = "MeinUserName"
$Domain = "MeineDomain"
$Password = "MeinPW"
RunAs($UserName, $Domain, $Password, 1,"cmd.exe /k hdwwiz.cpl", @SystemDir, @SW_SHOW)
WinWait("Geräte-Manager","Geräte-Manager")
WinActivate("Geräte-Manager","Geräte-Manager")
ControlSend("Geräte-Manager","Geräte-Manager", "[CLASS:SysTreeView32; INSTANCE:1]", "{TAB}" & "{ALT}" & "{RIGHT}" & "{ENTER}" & "{DOWN}" & "{DOWN}" & "{ENTER}")
WinWait("Hardware","Willkommen")
WinActivate("Hardware","Willkommen")
ControlClick("Hardware","Willkommen",12324)
WinWait("Hardware","Mit diesem")
WinActivate("Hardware","Mit diesem")
ControlClick("Hardware","Mit diesem",317)
WinWait("Hardware","Mit diesem")
WinActivate("Hardware","Mit diesem")
ControlClick("Hardware","Mit diesem",12324)
WinWait("Hardware","Alle Geräte anzeigen")
WinActivate("Hardware","Alle Geräte anzeigen")
ControlSend("Hardware","Alle Geräte anzeigen","", "{DOWN 8}" & "{ENTER}")
WinWait("Hardware","Wählen Sie")
WinActivate("Hardware","Wählen Sie")
ControlSend("Hardware","Wählen Sie",1580, "{DOWN 2}")
WinWait("Hardware","Wählen Sie")
WinActivate("Hardware","Wählen Sie")
ControlClick("Hardware","Wählen Sie",12324)
WinWait("Hardware","Die neue Hardware")
WinActivate("Hardware","Die neue Hardware")
ControlClick("Hardware","Weiter",12324)
WinWait("Hardware","Fertigstellen")
WinActivate("Hardware","Fertigstellen")
ControlClick("Hardware","Fertigstellen",12325)
Alles anzeigen