Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <001801c2aa18$c37f6bc0$c8c8a8c0@peace> From: =?iso-8859-1?Q?Peter_Valdemar_M=F8rch?= To: Subject: Tip: Running a bash script without the terminal window... Date: Mon, 23 Dec 2002 01:18:05 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 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:\WINNT\system32\wscript.exe c:\data\scr\quiet.vbs c:\cygwin\bin\bash --login -c "echo do your bashing stuff here > /tmp/somefile" I think all machines have the wscript.exe executable. The VB script is of course the central element, and here it is: ' http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OnQwYL0iCHA .1884%40tkmsftngp10&rnum=14 ' from the microsoft.public.win2000.cmdprompt.admin newsgroup ' But has been modified some by peter AT morch DOT com. Set oShell = CreateObject ("Wscript.Shell") Set objArgs = WScript.Arguments ' Join all the arguments.... for each arg in objargs cmd = cmd & """" & arg & """" & " " next oShell.Run cmd , 0, runwait -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/