This is the mail archive of the cygwin 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]

Problem to launch bash from a shotcut


I work since years with Cygwin and never found a nice
way to launch a "standalone" bash script from a
shortcut and/or a Windows batch file.

Say I have a directory with :
  bash.exe
  cygiconv-2.dll
  cygintl-3.dll
  cygncurses-8.dll
  cygreadline6.dll
  cygwin1.dll
  my_script    (a bash script)
  launcher.bat (or a shortcut)

This directory can be on a cd-rom, an unmapped network
share, a local drive, ...
Then the directory can be :
  D:\mydir\
  \\server\far away\mydir\
  C:\another path with spaces\mydir

It will be nice to just to have to double-clic on
launcher.bat

All I can manage to do is to launch from a mapped
drive.

launcher.bat :
set current_path=%~d0%~p0
"%current_path%bash.exe" "%current_path%my_script"

It is perfect, but only for local or mapped drives.
note : if I use the -c notation I have to use 
"%current_path%bash.exe" -c
"'%current_path%my_script'"

If I try it from a network share I get :
\server\far away\my_script: no such file or directory
Note the single first reverse slash.

I also tried :
set current_path=%~d0%~p0
"%current_path%bash.exe" -c "cd '%current_path%';
./my_script"
but I get the same error on the cd.


Any idea how I can instruct bash to execute from an
unmapped network share ?




	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]