문제

How do I Flip the Removable Bit of my USB Pen Drive or HDD in C# like this Tool does?

Thanks in advance!

도움이 되었습니까?

해결책

This is not easily done.

The "removable bit" is in the firmware of the controller on the device, not on the filesystem, and it is not accessible by anything but a custom tool for that device.

And since each chip manufacturer has different ways to access the firmware, and the firmware itself can be at different addresses, it is very unlikely that a universal tool can be made.

Your only option would be to sniff USB packets sent by the original utility, decode them and write a new tool which replicates the behavior.

The link you provide will not work on all USB devices, but works on many.

다른 팁

You could search the registry etc and use c# registry commands to 'flip' bits etc. But there is no garantee that the underlying drivers will support the configuration. If you require this functionality than buy a drive that supports it.

This answer probably belongs on Super User: The least fuss way to use a USB drive appear as part of a Hard Drive, is set NTFS symbolic link. Which will make your usb drive appear as a directory. You wont be able to partition it like a hard drive though, but you will be able to index it etc - i have several non hard drive devices configured as symbolic links and the music contained on them appears in media player and windows libraries, all searchable and removeable.

  • Create a directory on your hard drive to be the Mount point
  • Right Click my computer
  • Manage
  • From storage, go to disk management
  • right click your device
  • Choose Add Drive letter or Path
  • Add a path to the directory.

or use the mklink command

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top