This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: UNC paths are not supported. Defaulting to Windows directory.


Adrian C. Brown wrote:

>Why would I get this error when trying to start cygwin from the
>shortcut placed on the desktop?
>
>CMD.EXE was started with '\\coruscant\users\adrianb\Desktop' as the
>current dire ctory path.  UNC paths are not supported.  Defaulting to
>Windows directory.

NT-Shells only except working directories that are on a mapped directory
drive. 

>
>I am using Windows 2000 professional in a Windows 2000 domain with
>folder redirection.
>
>What can I do to solve this?

Here's my solution:

----------------------- bash.bat -----------------------------

@echo off
rem
rem  Bash.Bat
rem
rem  Add this registry entry to get a bash menu item in
rem  in your context menu (right mouse button) in the
rem  windows explorer.
rem
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Bash\command\Bash.Bat "%L"
rem

if %1%xxx == xxx goto usage

set CYGWIN=tty
set _NT_SHELL_DIR=%1
cd %_NT_SHELL_DIR%
shift
set _BASH_ARGS=%1 %2 %3 %4 %5 %6 %7 %8

bash.exe --norc -noprofile --login ~/.dosLogin
goto ende

:usage
echo "usage: Bash.bat working_directory [bash args]"
pause

:ende

-------------------------------- .dosLogin -------------------------

_BASH_SHELL_DIR=$(cygpath -u "$_NT_SHELL_DIR")
exec bash --norc -noprofile -c \
"cd $_BASH_SHELL_DIR 2>/dev/null; \
if [ $? = 0 ] ; then exec bash $_BASH_ARGS; fi"

----------------------------- end ------------------------------------

Now put Bash.Bat on your PATH and .dosLogin in you HOME directory. You may
now use a UNC working directory to start bash from the explorer context menu
(right mouse button) or via redirection. You still get an error message from
windows, that UNC Paths are unsupported. Bash will, however, have the UNC
directory as the working directory.

Hope this helps.

- Troy Holly 

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]