简体   繁体   中英

Powershell - set desktop background for specific user (Windows 7 and/or 2008 Server)

Assuming I am logged on as administrator, can I use PowerShell to assign a desktop background image to a specific user account?

I've seen answers similar to this one Powershell script from shortcut to change desktop where the following is used

RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);

Which, I assume, will work for the currently logged on user. How would I do that for the user that is not logged on (any user)?

The user did not have a desktop background set before.

Any other automated solution welcome, not limited to PowerShell.

The general consensus seems to be that you need to load the user's registry hive. I think this is what you're looking for: http://jrich523.wordpress.com/2012/03/06/powershell-loading-and-unloading-registry-hives/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM