Pregunta

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 .

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top