Cynosure.X International

Windows Path To Cygdrive (GPL)
Sun, 16 Mar 2014 06:36:38 +0000

"Windows Path To Cygdrive.cmd" is a Windows batch program that helps you convert Windows path to cygdrive (Cygwin) path. Many UNIX utilities (e.g. rsync) that are ported to Windows using Cygwin requires the cygdrive path, rather than the Windows path. This script allows you to set a global path variable once and use it everyone. See examples below for details.

"Windows Path To Cygdrive.cmd" takes advantage of the SetNumberOfArguments.bat (GPL) script that is available on this web site. So to use "Windows Path To Cygdrive.cmd", you'll have to download SetNumberOfArguments.bat, if you don't already have it.

"Windows Path To Cygdrive.cmd" is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.

Usage

  "Windows Path To Cygdrive.cmd" "path"

Usage Examples

  >"Windows Path To Cygdrive.cmd" "%UserProfile%"
/cygdrive/C/Users/Monkey

>"Windows Path To Cygdrive.cmd" "%ProgramFiles%"
/cygdrive/C/Program Files

>"Windows Path To Cygdrive.cmd" "%ProgramFiles(x86)%"
/cygdrive/C/Program Files (x86)

Programming Examples

  set photoPath=%UserProfile%\Desktop\Travel Photos

call SetVariableToOutput.bat ""Windows Path To Cygdrive.cmd" "%photoPath%""
set cygPath=%OutputVariable%

if exist "%photoPath%" (
rsync -auv --delete-during "%cygPath%/" "%serverPath%/"
)

In the example above, %photoPath% is only declared once. It is converted into the %cygPath% with this script. The example checks to ensure %photoPath" exists, while using %cygPath% for rsync.


Category:

Comments | Related Links | TrackBack


SetVariableToOutput.bat (GPL)
Sun, 16 Mar 2014 06:21:36 +0000

Made a minor change to the way commands are executed in SetVariableToOutput.bat. With this simple change, you can now pass in commands containing spaces. Quoting the command is much easier now. Here is an examples:

    call SetVariableToOutput.bat ""With Space.cmd" "a b c""

Note the two double-quotes in the front and the two double-quotes at the end? The extra double-quote at the front and at the end encloses the entire string as one command.

The new version of SetVariableToOutput.bat is attached below.


Category:

Comments (8) | Related Links | TrackBack (1)


IsDirectory.bat (GPL)
Mon, 17 Feb 2014 08:31:25 +0000

Found that the previous versions of "IsDirectory.bat" could not handle '&' character in directory and file name. Using crampies' tip above, I have updated the script to handle '&' correctly. The new version is attached below.


Category:

Comments (4) | Related Links | TrackBack


TakeControl: Change Log
Mon, 17 Feb 2014 06:39:15 +0000

Version 2.05

Fixed a bug where TakeControl could not handle '&' character in file and directory names. This new version will have no problem handling the '&' character.


Category:

Comments (6) | Related Links | TrackBack (1)


UI Demo in MDILet
Tue, 07 Jan 2014 08:18:43 +0000

Is "IBM MIDP 2.0 Java Emulator 2.3" runs on Windows CE 5.0 Emulator?


Category:

Comments (5) | Related Links | TrackBack


More . . .

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

52 Users Online

Hacking Digital Cameras
Fun for Photographers

Fresh Flower Delivery


Amazon Associate

Copyright © 1996 - 2014. All Rights Reserved.