Tuesday, June 7, 2011

Batch file to start up cygwin and bash

Put this file cw.bat in your scripts folder or somewhere on your path to easily fire up cygwin when needed:


@if not "%cygwin%"=="" goto ALREADY_SET 


@REM Set cygwin path here:
@SET cygwin=C:\cygwin\bin
@if exist %cygwin% set PATH=%cygwin%;%PATH%
@if not exist %cygwin% goto NOT_FOUND
@echo cygwin set up successful.
@goto END


:ALREADY_SET
@echo cygwin alredy set up.
@goto END


:NOT_FOUND
@echo cygwin path not found:
@echo %cygwin%
@goto END


:END


Also useful is this to start bash:


@echo off
C:
chdir C:\cygwin\bin
bash --login -i

No comments:

Post a Comment