forked from brianfgonzalez/Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComboBox.au3
More file actions
49 lines (45 loc) · 2.22 KB
/
ComboBox.au3
File metadata and controls
49 lines (45 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FileInstall("wsname.exe", @WindowsDir & "\Temp\wsname.exe", 1)
;FileInstall("joindomain.exe", @WindowsDir & "\Temp\joindomain.exe", 1)
;FileInstall("netdom.exe", @WindowsDir & "\system32\netdom.exe", 1)
;FileInstall("netdom.exe.mui", @WindowsDir & "\system32\en-US\netdom.exe.mui", 1)
;FileInstall("joindomain.exe", @WindowsDir & "\Temp\joindomain.exe", 1)
#include <GUIConstantsEx.au3>
#include <ComboConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
$sWSNAMECmdPath = @WindowsDir & "\Temp\wsname.exe"
Example()
Func Example()
Local $msg
GUICreate("System Type", 320, 150, -1, -1, $WS_POPUP + $WS_CAPTION) ; will create a dialog box that when displayed is centered
$ComboBox = GUICtrlCreateCombo("Student Tablet", 10, 10, 300, 30, $CBS_DROPDOWNLIST) ; create first item
GUICtrlSetData(-1, "Student Cart|Special Education|Alternate Education", "Student Tablet") ; add other item snd set a new default
$GoButton = GUICtrlCreateButton("Go", 110, 100, 100, 30)
GUISetState()
GUICtrlSetFont($ComboBox, 20, 10)
GUICtrlSetFont($GoButton, 20, 10)
Sleep(10000)
Exit
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GoButton ;Change Computer Name.
$menutext = GUICtrlRead($ComboBox, 1) ; return the text of the menu item
Select
Case $menutext = "Student Tablet"
Run($sWSNAMECmdPath & " /RESPACE /N:STUTAB$SERIALNUM[6+] /LOG C:\Windows\Temp\WSNAME.txt", @ScriptDir, @SW_HIDE)
Case $menutext = "Student Cart"
Run($sWSNAMECmdPath & " /RESPACE /N:STUSCTAB$SERIALNUM[6+] /LOG C:\Windows\Temp\WSNAME.txt", @ScriptDir, @SW_HIDE)
Case $menutext = "Special Education"
Run($sWSNAMECmdPath & " /RESPACE /N:STUSETAB$SERIALNUM[6+] /LOG C:\Windows\Temp\WSNAME.txt", @ScriptDir, @SW_HIDE)
Case $menutext = "Alternate Education"
Run($sWSNAMECmdPath & " /RESPACE /N:STUAETAB$SERIALNUM[6+] /LOG C:\Windows\Temp\WSNAME.txt", @ScriptDir, @SW_HIDE)
EndSelect
EndSelect
WEnd
EndFunc
Run("cmd /c reg add ""HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Runonce"" /V runforme /d c:\windows\temp\joindomain.exe /f")
Run("shutdown /r /t 05")