On 8/7/23, Roland Mainz via Cygwin  wrote:
> On Sat, Jul 29, 2023 at 6:18 AM Roland Mainz  wrote:
>> Is there an official way to enter the Cygwin command line (e.g. bash
>> login) from Windows cmd.exe, e.g. if someone ssh's into a Windows
>> machine he/she ends/up in a cmd.exe and not bash...
>
> ping!

Years ago this was the default way to start cygwin (I don't think I've
changed it, but who knows??)

C:\cygwin>type Cygwin.bat
@echo off

C:
chdir C:\cygwin\bin

bash --login -i


There's a Cygwin.bat in /etc/defaults that needs to be copied to the
cygwin root directory:

C:\cygwin>type etc\defaults\Cygwin.bat
@echo off
setlocal enableextensions
set TERM=
cd /d "%~dp0bin" && .\bash --login -i

C:\cygwin>

"cd /d" - Use the /D switch to change current drive in addition to
changing current directory for a drive.

"%~dp0" gives the path of the script, so if the .bat file is in
C:\cygwin then "%~dp0bin" expands to C:\cygwin\bin

Regards
Lee

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to