How to read thumb drive volume label
Buchbinder, Barry (NIH/NIAID) [E]
BBuchbinder@niaid.nih.gov
Mon Mar 14 16:38:00 GMT 2011
Charles Russell sent the following at Monday, March 14, 2011 10:03 AM
>Is there some way to read the volume label on a USB flash drive?
>Something like blkid in linux?
Something like this?
function label() {
$(cygpath --sysdir)/cmd /c dir ${1}:\\ | \
tr \\r \\n | \
sed -n -e '1s/^ Volume in drive . is //p'
}
Or you could play with
$(cygpath --sysdir)/label.exe
Note that both require that one provides the drive letter.
I hope this was not OT. I apologize for use of tools that come
with Windows, but sometimes I find native tools to be easiest.
- Barry
Disclaimer: Statements made herein are not made on behalf of NIAID.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list