Slash2135 Posted November 1, 2010 Share Posted November 1, 2010 Hey everyone, I am pretty new to AutoIT so I'm trying to figure out how everything works and what not. I found this cmd that is used to take ownership of Reg keys and thought it would be cool make a gui where the user simply puts the reg key into the input box and presses a button giving them ownership. This may sound dumb to some but for me and my IT team it would make our lives a little easier. The problem is, I don't know the command to take the input from the text box and insert it into the cmd line. I'm not asking anyone to write this for me, I'm just wanting a little advice and some direction. Thanks! Justin Link to comment Share on other sites More sharing options...
somdcomputerguy Posted November 1, 2010 Share Posted November 1, 2010 (edited) The Run and ShellExecute functions accept variables as arguments, so something like ShellExecute(GUICtrlRead($Input1), GUICtrlRead($Input2)) is doable. Edited November 1, 2010 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
UEZ Posted November 1, 2010 Share Posted November 1, 2010 I hope this will help you:#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 383, 131, 192, 124) $Label = GUICtrlCreateLabel("Commandline:", 8, 48, 109, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Input = GUICtrlCreateInput("ipconfig /all", 112, 48, 121, 21) $Button = GUICtrlCreateButton("Start in CMD", 256, 48, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($hGUI) Exit Case $Button $cmd = GUICtrlRead($Input) $pid = Run(@ComSpec & " /k " & $cmd, "") EndSwitch WEndBr,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ 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