This is the mail archive of the
mailing list for the Cygwin project.
Tip: Running a bash script without the terminal window...
- From: Peter Valdemar Mørch <peter at morch dot com>
- To: <cygwin at cygwin dot com>
- Date: Mon, 23 Dec 2002 01:18:05 +0100
- Subject: Tip: Running a bash script without the terminal window...
This is just a little tip I'd like to share.
It annoyed me for some time, that whenever I ran a bash script, I got a
terminal window whether or not my script needs it. Here is a Visual Basic
snippet that works for me on W2K and XP, and that runs a bash script without
the terminal. I use it to start xterms from windows shortcuts, for instance.
It really can start all kinds of things, also .bat files, if you like...
c:\cygwin\bin\bash --login -c "echo do your bashing stuff here >
I think all machines have the wscript.exe executable. The VB script is of
course the central element, and here it is:
' from the microsoft.public.win2000.cmdprompt.admin newsgroup
' But has been modified some by email@example.com.
Set oShell = CreateObject ("Wscript.Shell")
Set objArgs = WScript.Arguments
' Join all the arguments....
for each arg in objargs
cmd = cmd & """" & arg & """" & " "
oShell.Run cmd , 0, runwait
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html