This is the mail archive of the
mailing list for the Cygwin project.
Re: drag and drop to cygwin scripts ?
- From: Lewis Hyatt <lhyatt at princeton dot edu>
- To: cygwin at cygwin dot com
- Date: Fri, 14 Sep 2007 10:57:29 -0400
- Subject: Re: drag and drop to cygwin scripts ?
- References: <firstname.lastname@example.org>
Keith Chiem wrote:
Is it possible to write a script in cygwin, say bash or perl, create a shortcut to it in windows, and drag and drop a path or a url to it and have the script run and take it as an argument somehow ?
If you drag and drop files onto a batch script, Windows will run the
batch script with the files as arguments. So you just need to write a
batch script which will load bash and tell it to run your script with
those arguments. As an example, you can edit your cygwin.bat, and change
bash --login -i
bash -i -e /script/you/want/to/run.bash %*
And that will do what you want. Keep in mind that the file names will be
in the Windows path format, so you will probably want to use a wrapper
script that applies cygpath to them before passing them on to something
If you want the script to run inside an xterm or whatever, you can do
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html