Sign in to follow this  
Followers 0
kasamiko

GUI for DOS command

5 posts in this topic

hi,

this is my first post please be gentle guys..:graduated:

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

Share this post


Link to post
Share on other sites



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.)

Share this post


Link to post
Share on other sites

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.)

Thanks..this can be a good start...:graduated:

how about adding option to browse for myfile.dat?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I'll spend some time with this...hope to create a descent script later...

tnx..

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0