X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_05,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: <4D719B8C DOT 9090904 AT cs DOT umass DOT edu> Date: Sat, 5 Mar 2011 20:09:11 -0700 Message-ID: Subject: Re: Windows Shortcut That Runs Cygwin Command From: Keith Christian To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Panos, I don't have Windows 7, however, this procedure is generic enough that it should work. Try it and let me know. 1. Create this plain DOS .cmd file in c:\cygwin\usr\local\bin\dos2cygwin.cmd. Line endings should be CRLF so it may be best to create this with Notepad. @echo off echo. echo.------------------------------------------------------------------------------- echo.Welcome to the DOS batch file dos2cygwin.cmd echo.------------------------------------------------------------------------------- echo. REM Ping below provides a time delay like the sleep command ping -n 5 127.0.0.1 > nul: echo.About to run the dos2cygwin.sh BASH script..... echo. REM Ping below provides a time delay like the sleep command ping -n 5 127.0.0.1 > nul: @echo on bash -c "export LANG=C ; /usr/local/bin/dos2cygwin.sh" @echo off echo. echo.Back in the batch file after running /usr/local/bin/dos2cygwin.sh echo. REM Ping below provides a time delay like the sleep command ping -n 5 127.0.0.1 > nul: echo. echo.------------------------------------------------------------------------------- echo.Goodbye from the DOS batch file dos2cygwin.cmd echo.------------------------------------------------------------------------------- echo. 2. Create this .sh script in /usr/local/bin/dos2cygwin.sh : #!/bin/bash echo echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "Welcome to the Cygwin BASH script dos2cygwin.sh, called by dos2cygwin.cmd" echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo sleep 5 echo "Here is a calendar for the current month" cal echo sleep 7 echo "Let's see if port 445 is open on this Windows machine" netstat -an | grep -w 445 sleep 5 echo echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "Goodbye from the Cygwin BASH script dos2cygwin.sh, called by dos2cygwin.cmd" echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo sleep 2 3. At the Cygwin BASH prompt, set execute permission for dos2cygwin.sh chmod +x /usr/local/bin/dos2cygwin.sh 4. Right click on the Windows desktop and create a new shortcut. 5. In the Type the location of the item field in the new shortcut, paste in the following text, (adjusting for Windows 7's location of CMD.EXE:) C:\WINDOWS\system32\cmd.exe /c C:\cygwin\usr\local\bin\dos2cygwin.cmd 6. Click Next, then click Finish. 7. On the desktop, find the shortcut just made, double click, and the script should run. 8. You can run this "manually" by opening a CMD.EXE window, and typing the command line at the prompt: C:\Users\Keith> C:\cygwin\usr\local\bin\dos2cygwin.cmd 9. DONE. Let me know if this works out, have fun. =====Keith -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple