I want to hide the drive from user with Diskpart Command-Line Utility .
I use remove letter command and the drive becomes hidden .
But I want to use the data of that drive for example in my program written in C .
How I can do this or is it possible ?
I want to do this only for usb flash drives .
If it is not possible please give me another approach to do this correctly ?
Thanks a lot , good luck .
You can use the volume GUID like this:
\\?\Volume{2a0b16cf-f76a-11df-9310-806e6f6e6963}\path\file.ext
Note that only the Unicode file functions will accept this sort of path, and the syntax has to be strictly correct. For example, you can't use forward slashes instead of backslashes.
I'm not sure how best to enumerate the volume GUIDs. One method is QueryDosDevice
but I expect there are better ways.
来源:https://stackoverflow.com/questions/17090863/how-to-get-access-after-hide-the-drive-with-diskpart-command-line-utility