Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3EFE120B.58A0C79E@dessent.net> Date: Sat, 28 Jun 2003 15:09:15 -0700 From: Brian Dessent Organization: My own little world... X-Accept-Language: en,pdf MIME-Version: 1.0 To: Soren A CC: cygwin AT cygwin DOT com Subject: Re: example needed pls: `cygpath -c ' References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Soren A wrote: > * yeah, am using AS Perl, that's because this is a piece of > a WSH script. > * what I'd like to end up with is a way to context|alternate-click > on any filename in MSWindows Explorer and place the filename as > *cygwin*, not the OS, will see it, on the clipboard. Anyone > already had a pass at this wheel? I was playing around with this because it seems like a handy idea. I use Cywin perl, but the differences shouldn't be very great. Anyway, I came up with the following oneliner that does what you mention above (passed %1 as a Windows filename, it copies the Cygwin version to the clipboard) c:\cygwin\bin\perl.exe -MWin32::Clipboard -e "my $f=quotemeta('%1'); chomp (my $c=qx!cygpath -u $f!); Win32::Clipboard($c);" If you install the following registry entries, you get a context menu for files and directories that runs this when selected. You should be able to save this as a .REG file and click on it to import the entries, you'd have to change the path to perl though. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\CygPath] @="&Copy Cygwin Path" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\CygPath\Command] @="c:\\cygwin\\bin\\perl.exe -MWin32::Clipboard -e \"my $f=quotemeta('%1'); chomp (my $c=qx!cygpath -u $f!); Win32::Clipboard($c);\"" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\CygPath] @="&Copy Cygwin path" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\CygPath\command] @="c:\\cygwin\\bin\\perl.exe -MWin32::Clipboard -e \"my $f=quotemeta('%1'); chomp (my $c=qx!cygpath -u $f!); Win32::Clipboard($c);\"" Brian -- 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/