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]

Batch-style variables to detect change in Cygdrive

Is there anyway I can get batch-style relative drive paths in Cygwin? An example of what I mean is "%~d0". The reason for is is that I would like to mount folders from a USB, so the drive (the variable I showed does drive) will change everytime I plug the USB in. After abit of playing around I found how to mount folders, but it needs be ran from inside Cygwin via a file ran on start-up or written manually. I am attempting to set the mounts from a batch script or atleast get a variable/function that will find out what drive to use. Below is some examples I've cooked up.

# batch-style
set "mono1=cygpath --type windows "%~d0\mono\""
set "mono2=cygpath --type mixed "%~d0/mono/""
set "mono3=cygpath --type unix "/cygdrive/%~d0/mono/""
mount -o binary '%mono1%' /mnt

# Cygwin-style
mount -o binary "$(cygpath --type windows "%~d0\mono\)" /mnt
mount -o binary "$(cygpath --type mixed "%~d0/mono/)" /mnt
mount -o binary "$(cygpath --type unix /cygdrive/%~d0/mono/)" /mnt

Problem reports:
Unsubscribe info:

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