Spyder25000 Posted March 23, 2007 Share Posted March 23, 2007 Hi i am making a GUI. how do i make Var's? i want a input box on my GUI that makes it a var and it will do it e.g Which reg do you want to del [ ] What do you want admin password to be [ ] (Var pass and the code i need to send it Send ("%1%") Link to comment Share on other sites More sharing options...
tAKTelapis Posted March 23, 2007 Share Posted March 23, 2007 variables are defined with the $ sign in auto IT so, in batch: set var=Hello World ! echo. %var% in AutoIT: $var = "hello World !" msgbox(0, "Hello World", $var) To set a variable to an input on a GUI: $var = GUICreateInput("define deatils for input here) and you will have to GUICtrlRead($var) to get the value that the user has typed. check the examples on the functions i have noted in the helpfile for more information. Link to comment Share on other sites More sharing options...
EndFunc Posted March 23, 2007 Share Posted March 23, 2007 Hi i am making a GUI. how do i make Var's? i want a input box on my GUI that makes it a var and it will do it e.g Which reg do you want to del [ ] What do you want admin password to be [ ] (Var pass and the code i need to send it Send ("%1%") Your question is a little confusing. Do do you want a button that give you an input box or something like that? See if this will help you. #include <GUIConstants.au3> $AppTitle = "My Gui" $MyGui = GUICreate("MyGui", 395, 229, -1, -1) $RegInput = GUICtrlCreateInput("", 192, 32, 153, 21) $RegLabel = GUICtrlCreateLabel("What reg do you want to delete?", 16, 35, 159, 17) $PassInput = GUICtrlCreateInput("", 248, 72, 129, 21) $PassLabel = GUICtrlCreateLabel("What do you want your admin password to be?", 16, 75, 226, 17) $RegChk = GUICtrlCreateButton("RegChk", 66, 136, 113, 49, 0) $PassChk = GUICtrlCreateButton("PassChk", 228, 136, 113, 49, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $RegChk $RegStatus = GUICtrlRead($RegInput) MsgBox(64, $AppTitle, "Reg key to be deleted is - " & $RegStatus) Case $PassChk $PassStatus = GUICtrlRead($PassInput) MsgBox(64, $AppTitle, "Password set to - " & $PassStatus) EndSwitch WEnd EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
Spyder25000 Posted March 23, 2007 Author Share Posted March 23, 2007 i just want a here is my script so far V 1.3; AutoIt 3.0.103 example; 17 Jan 2005 - CyberSlug; This script shows manual positioning of all controls;; there are much better methods of positioning...#include <GuiConstants.au3>; GUIGuiCreate("Win Utilitys", 525, 300)GuiSetIcon("WinUtilitys.exe")Opt("GUICoordMode",2)GUICtrlCreateLabel ("Version 1.3", 15, 35, 100) $Button_1 = GUICtrlCreateButton ("Deletes the Wireless Policy", 15, 35, 150)$Button_2 = GUICtrlCreateButton ("Change Admin password", 0, -1)$Button_3 = GUICtrlCreateButton ("Change admin password to origanal - deltakilo", -300, -50, 300); MENU GuiCtrlCreateMenu("File")GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Wireless") ; Delte Reg Case $msg = $Button_2 Run ("cmd.exe") ; Cmd open Sleep (1000) Send ("Net User Administrator *{ENTER}") MsgBox ( 64, "WARNING", "Your are about to change Admins password") MsgBox (64, "REMEBER", "You can change the password back via the other menu") Case $msg = $Button_3 Run ("cmd.exe") ; Cmd open Sleep (1000) Send ("Net User Administrator *{ENTER}") Sleep (500) Send ("deltakilo{Enter}") Sleep (500) Send ("deltakilo{Enter}") MsgBox ( 64, "Password set", "Password is now Normal, deltakilo") EndSelectWend; GUI MESSAGE LOOPGuiSetState()While GuiGetMsg() <> $GUI_EVENT_CLOSEWEndAs you can see i want that password chnage so in button 2 press it will take input from the gui and change the password to that, thanksis it possable to make a .txt docuemnt to report what they have changed it to ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now