plzhelp Posted April 23, 2011 Share Posted April 23, 2011 Hey I wanna do a RUN function with cmd line. But.. I want to do it with reading a input.. How can I do that ? Is it possible ? Example: Run('"notepad.exe" blablabalba & GuiCtrlRead($blablabla)') ? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 23, 2011 Developers Share Posted April 23, 2011 (edited) Sure, something like this: Run('"notepad.exe" blablabalba ' & GuiCtrlRead($blablabla)) By the way: isn't your begging streak a little overkill?: Membername, Topic title and subtitle? Just try to give your Topic titles a more meaningful text. Jos Edited April 23, 2011 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Donald8282 Posted April 24, 2011 Share Posted April 24, 2011 Here's a simple script like what you're talking about. #include <GUIConstantsEx.au3> GUICreate("Example", 200, 100) GUISetState() $Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20) $Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button $RunGet = GUICtrlRead($Run) If $RunGet <> "" Then Run($RunGet) If @error Then MsgBox(16, "Error", "File not found") EndIf Else MsgBox(16, "Error", "No text entered") EndIf EndSelect WEnd Link to comment Share on other sites More sharing options...
Rogue5099 Posted April 24, 2011 Share Posted April 24, 2011 (edited) Simple InputBox Example: While 1 $Run = InputBox("Example", "Enter .exe to Run", "notepad.exe") If @error = 1 Then Exit If Run($Run) = 0 Then MsgBox(16, "Error", "File not found") WEnd Donald8282's Example Simplified: #include <GUIConstantsEx.au3> GUICreate("Example", 200, 100) GUISetState() $Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20) $Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Button If Run(GUICtrlRead($Run)) = 0 Then MsgBox(16, "Error", "File not found") EndSwitch WEnd Edited April 24, 2011 by rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
Donald8282 Posted April 24, 2011 Share Posted April 24, 2011 Simple InputBox Example: While 1 $Run = InputBox("Example", "Enter .exe to Run", "notepad.exe") If @error = 1 Then Exit If Run($Run) = 0 Then MsgBox(16, "Error", "File not found") WEnd Donald8282's Example Simplified: #include <GUIConstantsEx.au3> GUICreate("Example", 200, 100) GUISetState() $Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20) $Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Button If Run(GUICtrlRead($Run)) = 0 Then MsgBox(16, "Error", "File not found") EndSwitch WEnd I was thinking of doing it that way but I had time on my hands and nothing to do =P 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