how to get access after hide the drive with Diskpart Command-Line Utility

痴心易碎 提交于 2019-12-06 14:53:02

问题


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:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!