May 27, 2019, 01:56:33 am

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Understanding the windows registry - Disk drives

Started by Andy, October 11, 2016, 11:31:38 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

October 11, 2016, 11:31:38 pm Last Edit: October 11, 2016, 11:35:11 pm by Andy
Pressing on with the registry, Brian asked about how you can disable USB drives on your machine.

So attached is the code to do just that.

Please read this before using the code:

When you run the program (please do so as Admin i.e. right click on drives.exe and run as Administrator), you will see a simple screen with 26 check boxes, one for each letter of the alphabet.

Simply tick a drive letter you want to hide and click Apply.

Wait for your desktop / taskbar to re-fresh (this can take between 1 and say 5 seconds) depending on what your system is doing at the time.

If for some reason, it doesn't start up again, you can use Task manager to start a new task and enter explorer.exe.

Failing that, restart your computer.

With the desktop / taskbar refreshed, now go to file explorer and see if you can see the drive you've just hidden - if it's worked correctly, the drive should be gone.

Now you can click on Show drive x (or what ever drive you selected), click Apply and check it's come back into view.

Simply close the program when finished.

You can always click on Show all drives to clear your system, and there is another way which is documented in the code.

So how do you use it to disable USB drives then?

When I connect my usb stick, it appears as drive "I", all the other drives before drive "I" are in use, so I can either just disable drive I, or better still disable drives I to Z (just in case windows decides to use drive J, K, L etc..).

Don't forget that this program hides drives from you the current logged on user, and if you wanted to use your USB stick you would have to remember to enable the corresponding drive with this program again.

Is there a way to allow me to see all drives but hide one from another user (another user account)? - yes.

I will show you that in the next tutorial.

I would strongly suggest you do not hide your system c: drive.

Please use this code responsibly!

Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Andy,

Works perfectly - you have got to remember to run it as Administrator, which I didn't do for a start, and was calling you all the names under the sun!

I put a USB stick in first, so I could check the drive letter exactly, because USB drive letters can float about a bit

It could actually do with more information about the drive letters, as to what kind of drive is actually being processed,
whether it is an HD, DVD ROM, USB port or SSD, etc. That would help you to not press the wrong one!

Otherwise, spot on!

Brian

Andy

Brian,

I'm actually just doing that about the drives (i.e. fixed disk with it's label name i.e.
"Hide C drive Windows 10").

Glad it works perfectly for you, and thought my ears were burning befiore  :)

I will post an update to it a.s.a.p.

Thanks for trying it,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Attached is the updated drives program with drive label names included for ease of use.

Download and overwrite the old files (if they are there).

Same as before - compile then run drives.exe as Admin
(i.e. right click on drives.exe and run as Administrator)

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.