January 20, 2022, 06:26:33 AM


Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........

Understanding the windows registry - Making changes to another user - Part 2

Started by Andy, October 14, 2016, 05:18:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


In this tutorial, we will change another user's registry settings.

1. This example assumes that you have created at least one extra user account on your machine.

2. For testing purposes I propose you call the new account "Test" (without the quotes).

3. You must log into this new account at least once to allow windows to finish the setup of this new account.

4. This new account must not be logged on whilst running this example program.

Sub routines of note:
- LoadUser (loads the selected user's hive into the registry).
- UnloadUser (the opposite of LoadUser).

These two sub routines were written with the help of the now, much missed Sapero.

This program will not allow you to hide your own disk drives, but will allow you to select a different user account from yours, and hide drives from them.

And it should be noted, this still works even if they have a password on their user account.

So this program will do the following:

1. Enumerate users on your machine.
2. Allow you to select a user account (other than your own) and load it.
(Select a different user account than yourself such as "Test" and click "Next").
3. As before, select a drive or drives you want to hide and click "Apply".
4. When finished, click "Quit" to unload the user and end the program.


Do the above steps (1 to 4), then log into the Test account, a drive or drives should be hidden from them (on my PC I ran this from Anne's account and hid drives from my account "Andy") .

Log out of the Test account, go back to your own and repeat the steps again, this time select to show the hidden drives, apply and quit.

Finally, log back into the Test account, and check the drives are showing again.

Attached is the code. (compile and run UsersDrives.exe as Administrator!, i.e right click on the exe file and select Run as Administrator).

A note about loading user account hives:
The process will fail if that user account is currently logged on - I have not made provision for that in this example as this is not the purpose of the tutorial.

A note about my Registry.inc file:
The basics of the include file were not written by myself, so I can't take the credit for them, with Sapero's help I was able to add in Load User and Unload User functions.

I took it further by adding in reading / writing Binary, Qword, Multi strings, and Expandable string values.

And if you want to use the include file AND you use windowssdk.inc you must always start your program like this -

$define __winreg_inc__ 'Always use this with Registry.inc if you have windowssdk.inc included.
$include "windowssdk.inc"
$include "Registry.inc"

This works on my machine, so please have a go and let me know if it works on yours!


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