Jump to content

AutoIT GUI | SID Changer DropDown


PatrickJ
 Share

Recommended Posts

Hello guys!

I have the following problem:

For work I have to create a AutoIT Script for changing the name of the computer (names are predefinied) and the User SID (random). So I have created a drop-down menu for choosing the computer names, but the problem is, that AutoIT is not pasting the value from the drop-down menu into the right form. It's pasting the Control ID into the form - did I use the bad function??

I'm really sorry for my bad english - take a look on this video - I'm sure u're gonna understand it better:

http://bit.ly/7eu7gk

Thank u very much for ur help!

-dave

The sourcecode:

;   AUTOIT SCRIPT FÜR MS WINDOWS VISTA/7 SID CHANGER & WSUS


#NoTrayIcon
#RequireAdmin


Run ("newsid.exe")

;Only needed for the first run
;WinWaitActive ("NewSID License Agreement", "&Agree")
;Send ("!a")

WinWaitActive ("NewSID - Sysinternals: www.sysinternals.com", "&Next >")
Send ("(!n)")

WinWaitActive ("NewSID - Sysinternals: www.sysinternals.com", "&Next >")
Send ("(ENTER)")


; ------------------- GUI-START ---------------------------------- 

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)  ; Wechsle in den OnEvent Modus 
$mainwindow = GUICreate("Computername", 190, 110)
GUICtrlCreateLabel("Bitte Computername auswählen!", 10, 10)

$input = GUICtrlCreateCombo ("", 10,40) 
GUICtrlSetData(-1,"SCHULUNG 1|SCHULUNG 2|SCHULUNG 3|SCHULUNG 4|SCHULUNG 5|SCHULUNG 6|SCHULUNG 7|SCHULUNG 8|MESSE 1|MESSE 2|MESSE 3|MESSE 4","") 
 
$Uebernehmen = GUICtrlCreateButton("Uebernehmen", 50, 70, 90)
GUICtrlSetOnEvent($Uebernehmen, "CLOSEClicked")

GUISetState(@SW_SHOW)

While 1
  Sleep(1000)  ; Häng rum
WEnd

Func CLOSEClicked()
    WinActivate("NewSID - Sysinternals: www.sysinternals.com","&Rename the computer to:")
    Send ("!r")
    Send ($input)
  Exit
  
EndFunc
Edited by PatrickJ
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...