Mail Archives: cygwin/2011/03/05/22:09:28
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: | <AANLkTi=k-fLSXRfAGqShbiVM26V1OErPEGU7rMpj_ic9@mail.gmail.com>
|
References: | <AANLkTi=NA6pjXtjo07GbNSyJQ8h_pGm9BuJEfY2NkWTM AT mail DOT gmail DOT com> <4D719B8C DOT 9090904 AT cs DOT umass DOT edu> <AANLkTi=k-fLSXRfAGqShbiVM26V1OErPEGU7rMpj_ic9 AT mail DOT gmail DOT com>
|
Date: | Sat, 5 Mar 2011 20:09:11 -0700
|
Message-ID: | <AANLkTinS6MuZbrgSHNaB4Cp_0Ohd8pSdvT1iGQfYsRAx@mail.gmail.com>
|
Subject: | Re: Windows Shortcut That Runs Cygwin Command
|
From: | Keith Christian <keith1christian AT gmail DOT com>
|
To: | cygwin AT cygwin DOT com
|
X-IsSubscribed: | yes
|
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm
|
List-Id: | <cygwin.cygwin.com>
|
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
|
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com>
|
List-Archive: | <http://sourceware.org/ml/cygwin/>
|
List-Post: | <mailto:cygwin AT cygwin DOT com>
|
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
|
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
- Raw text -