Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OT: GUI input for under Windows/CMD/BAT

43 views
Skip to first unread message

Mike Sanders

unread,
May 17, 2016, 1:08:47 PM5/17/16
to
In another universe, someone I know here once asked:

> So, I have written a batch file, and it works fine from the CMD.EXE prompt.
>
> However, one of the users doesn't like the prompt and wants to run it by
> double-clicking. But the batch file needs a parameter (%1).
>
> Is there any way to make the script put up a GUI window and prompt for that
> parameter (if it detects that %1 is empty) ?

Sure enough, an example:

:: awk.cmd - beware wordwrap...
:: look for tool 'Winput' at <http://www.horstmuc.de/w32dial.htm>
:: (others utilities of interest there too...)

@echo off

:: accumulate output...
for /f %%x in ('winput "title here" $input "please enter path to file"') do set VAR=%%x

:: parse %VAR%...
gawk.exe -f report.awk < %VAR%

:: *bonus points* see also 'sh2exe' <https://sourceforge.net/projects/sh2exe/>
:: (bundles busybox, ash, awk, & your sh script into a single win exe...)
::
:: eof

--
Mike Sanders
www.peanut-software.com

Marc de Bourget

unread,
May 17, 2016, 2:42:27 PM5/17/16
to
Hi Mike,

thank you, interesting.

"Busybox" ... is this kind of "Cygwin"?

Marc de Bourget.

Kenny McCormack

unread,
May 17, 2016, 3:27:47 PM5/17/16
to
In article <58748b73-68a2-44cc...@googlegroups.com>,
Marc de Bourget <marcde...@gmail.com> wrote:
>Hi Mike,
>
>thank you, interesting.
>
>"Busybox" ... is this kind of "Cygwin"?

Heh heh.

You might try Googling it.

--
(Cruz certainly has an odd face) ... it looks like someone sewed pieces of a
waterlogged Reagan mask together at gunpoint ...

http://www.rollingstone.com/politics/news/how-america-made-donald-trump-unstoppable-20160224

Mike Sanders

unread,
May 17, 2016, 3:36:04 PM5/17/16
to
Marc de Bourget <marcde...@gmail.com> wrote:

> Hi Mike,
>
> thank you, interesting.
>
> "Busybox" ... is this kind of "Cygwin"?

Hello Marc =)

By size (& features implemented)...

Cygwin = papa bear
MinGW = momma bear
Busybox = baby bear

Under Win invoke bb as: 'busybox tool' where 'tool' is
for instance awk, or invoke as 'busybox ash' & once within
the shell, all the other tools are available...

<https://frippery.org/busybox/>

--
Mike Sanders
www.peanut-software.com

Marc de Bourget

unread,
May 17, 2016, 3:40:20 PM5/17/16
to
Le mardi 17 mai 2016 21:36:04 UTC+2, Mike Sanders a écrit :
> Hello Marc =)
>
> By size (& features implemented)...
>
> Cygwin = papa bear
> MinGW = momma bear
> Busybox = baby bear
>

Hi Mike,
funny. I think I like the momma bear most :-)
0 new messages