Command Line GUI Creator

J

James Arnold

Are there any programs that can create a simple GUI for a command line
tool? It can be a pain in the *** to have to load cmd prompt every time
I need to use a command line only program :/
 
L

Luigi M Bianchi

How about leaving the cmd prompt always on?

/luigi


Are there any programs that can create a simple GUI for a command line
tool? It can be a pain in the *** to have to load cmd prompt every
time I need to use a command line only program :/



--
Luigi M Bianchi
Science and Technology Studies
Room 2069 TEL Building
York University, 4700 Keele St, Toronto, Ontario, Canada M3J-1P3
phone: +1 (416) 736-2100 x-30135 fax: +1 (416) 736-5188
mail: lbianchi at yorku dot ca http://www.yorku.ca/sasit/sts/
 
M

Mel

Are there any programs that can create a simple GUI for a command line
tool? It can be a pain in the *** to have to load cmd prompt every time
I need to use a command line only program :/
AutoIt v3 is a freeware BASIC-like scripting language designed for
automating the Windows GUI and general scripting. It uses a combination
of simulated keystrokes, mouse movement and window/control manipulation
in order to automate tasks in a way not possible or reliable with other
languages (e.g. VBScript and SendKeys). AutoIt is also very small,
self-contained and will run on 95, 98, ME, NT4, 2K, XP, 2K3 out of the
box with no annoying "runtimes" required! You can even make compiled
executable scripts that can run without AutoIt being installed!

http://www.autoitscript.com/autoit3/index.php
 
G

ggrothendieck

James said:
Are there any programs that can create a simple GUI for a command line
tool? It can be a pain in the *** to have to load cmd prompt every time
I need to use a command line only program :/

If you are looking for some free utlities that you can call
from a batch file, do a google search for "Frank Westlake
utilities".

A completely different approach is HTA technology. This
technology is available for free and comes with Windows so
you already have it on your Windows computer. It lets you
use HTML for defining the GUI and vbscript, jscript or any
Microsoft Active Scripting language (which includes perl,
python, tcl, oorexx and others) for the code just as if it
were a web page. Do a google search for "Hooked on HTAs"
for an intro.
 
W

w4tch3r

I had the same problem a while ago. Wrote 2 batch files and 1 Autoit
script:

- run.bat
- run_with_pause.bat
- run_with_parameters.au3

The first just runs it, the second runs it and stops, the third prompts
for parameters, runs it, then pipes output to a log file. I have links
to all 3 in my Send To folder (compile au3 to exe first). Works ok,
just right click in Explorer window.

Great thread, I'm going to check out the other suggestions,

w4tch3r


Here's the contents of each file:

------------------------------------------------------------------------
Run.Bat:
call %1

------------------------------------------------------------------------
Run_with_pause.bat:
call %1
pause

------------------------------------------------------------------------
Run_with_parameters.au3:
; set log file. currently set to write to the same dir as this script
$logfilepath = @ScriptDir
$logfilename = "Run With Parameters Output.txt"

; check that we have a command line parameter
if $CmdLine[0] = 0 then
msgbox(0, "Error - No Parameters!", "Run With Parameters needs one
command line parameter (the CMD.EXE to be run)")
exit
endif

; get/make progname
$cmdpath = StringSplit($CmdLine[1], "\")
$progname = $cmdpath[$cmdpath[0]]
$progpath = StringTrimRight ( $CmdLine[1], Stringlen($progname))
$logfile = """" & $logfilepath & "\" & $logfilename & """"
RunWait(@ComSpec & " /c echo Timestamp: " & _NowDate() & " " & _NowTime
() & " > " & $logfile, $progpath, @SW_MINIMIZE)
RunWait(@ComSpec & " /c echo Program Name: " & $progname & " >> " &
$logfile, $progpath, @SW_MINIMIZE)
RunWait(@ComSpec & " /c echo Program Path: " & $progpath & " >> " &
$logfile, $progpath, @SW_MINIMIZE)

; ask for parmeters
$params = InputBox($progname & " parameters", "Parameters?", "", "",
400, 100, -1, -1)
if @error then exit
RunWait(@ComSpec & " /c echo User Entered Params: " & $params & " >> "
& $logfile, $progpath, @SW_MINIMIZE)

; generate cmd
$cmd = $progname & " " & $params
RunWait(@ComSpec & " /c echo Command Line: " & $cmd & " >> " &
$logfile, $progpath, @SW_MINIMIZE)

; ask user if generated cmd is ok
;MsgBox(1, "Launch " & $progname & " with:", $cmd)
;if @error then exit

; run command, pipe output to log file
RunWait(@ComSpec & " /c echo
_________________________________________________" & " >> " & $logfile,
$progpath, @SW_MINIMIZE)
RunWait(@ComSpec & " /c echo." & " >> " & $logfile, $progpath,
@SW_MINIMIZE)
RunWait(@ComSpec & " /c echo." & " >> " & $logfile, $progpath,
@SW_MINIMIZE)
RunWait(@ComSpec & " /c " & $cmd & " >> " & $logfile, $progpath,
@SW_MINIMIZE)
RunWait(@ComSpec & " /c echo." & " >> " & $logfile, $progpath,
@SW_MINIMIZE)
RunWait(@ComSpec & " /c echo." & " >> " & $logfile, $progpath,
@SW_MINIMIZE)
RunWait(@ComSpec & " /c echo
_________________________________________________" & " >> " & $logfile,
$progpath, @SW_MINIMIZE)

; open log file
;$editornamepath = "j:\_apps\scite\scite.exe"
;$showlogcmd = """" & $editornamepath & """ " & $logfile
;Runwait($showlogcmd)
$showlogcmd = "type_pause.bat " & """" & $logfilename & """"
RunWait(@ComSpec & " /c " & $showlogcmd, $logfilepath)
 
S

stormblast1998

Good program, is it possible for the actual command line window (the
DOS console window) not to go away in case there are error and other
messages?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top