how to get access after hide the drive with Diskpa

2020-08-04 10:24发布

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 .

1条回答
Anthone
2楼-- · 2020-08-04 10:50

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.

查看更多
登录 后发表回答