0

当用户注销时,我需要更改 Windows 内置的来宾帐户注册表配置单元。有谁知道它存储在哪里?

4

1 回答 1

1

The registry hive for the guest account will normally be in c:\users\guest\ntuser.dat, the same as any other account. (Note that in some cases the profile might have a different name, e.g., if there is a domain guest user and that profile was created first. Also, for Windows XP and earlier, the path is c:\documents and settings\guest\ntuser.dat.)

You can load this hive into the registry using RegLoadKey and then manipulate it using the normal registry functions.

When you're finished with it, use RegUnLoadKey. This will make sure all your changes are saved, although this will also happen automatically when the machine shuts down. It will also release the lock on the file so that the account can log in again.

(I'm not sure what will happen if someone tries to log in while you've manually loaded the user hive. I recommend you disable the account before loading the hive and re-enable it after unloading.)

于 2012-11-07T20:40:30.737 回答