kasamiko Posted October 31, 2010 Posted October 31, 2010 hi, this is my first post please be gentle guys.. I'm planning to create a GUI for a simple DOS command something like this: myprog.exe -p Path\To\myfile.dat where: myprog.exe is my external program for myfile.dat both myprog.exe and myfile.dat will reside on the same folder.. TIA
HavikTech Posted October 31, 2010 Posted October 31, 2010 One simple example: $command = "myprog.exe -p Path\To\myfile.dat" $x = InputBox("Title", "Whs the command?", $command, "", -1, -1, 0, 0) If $x = $command then ShellExecuteWait($command) Else MsgBox(64, "incorrect", "Command") EndIf (Sorry, don't have autoit installed.)
kasamiko Posted October 31, 2010 Author Posted October 31, 2010 One simple example:$command = "myprog.exe -p Path\To\myfile.dat"$x = InputBox("Title", "Whs the command?", $command, "", -1, -1, 0, 0)If $x = $command thenShellExecuteWait($command)ElseMsgBox(64, "incorrect", "Command")EndIf(Sorry, don't have autoit installed.)Thanks..this can be a good start...how about adding option to browse for myfile.dat?
HavikTech Posted October 31, 2010 Posted October 31, 2010 I just installed Autoit, Here is another Example using GUI #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Run", 309, 125, 353, 360) $Label1 = GUICtrlCreateLabel("Type the name of a program, folder, document, or", 56, 8, 237, 17) $Label2 = GUICtrlCreateLabel("Internet resource, and Windows will open it for you.", 56, 32, 245, 17) $Icon1 = GUICtrlCreateIcon("C:\Program Files\AutoIt3\Icons\au3.ico", -1, 8, 8, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP)) $Input1 = GUICtrlCreateInput("", 56, 56, 241, 21) $Button1 = GUICtrlCreateButton("ok", 224, 88, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ShellExecuteWait($Input1) EndSwitch WEnd I Used "Koda" for creating the GUI, you can too... Always remember to read help file, it 've all the information + basic tutorials.
kasamiko Posted October 31, 2010 Author Posted October 31, 2010 I'll spend some time with this...hope to create a descent script later... tnx..
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