Sign in to follow this  
Followers 0
PatrickJ

AutoIT GUI | SID Changer DropDown

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



you're sending the combobox handle, not it's content - try replacing

Send($input)

with

Send(GUICtrlRead($input))

HTH,

whim

Share this post


Link to post
Share on other sites

You're a GENIOUS!

Thank u so much! It work's now! ;-)

Share this post


Link to post
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
Sign in to follow this  
Followers 0