Set registry key for wallpaper solid color

梦想的初衷 提交于 2020-01-02 21:04:46

问题


The first part of the script does work (when the key exists - if not that's OK, that's why I have On Error Resume Next).

But the 2nd part is what I am concerned about. It DOES NOT ERR, and I can see in Regedit that it did, indeed, set the Background to "0 0 0", but when I refresh the wallpaper, nothing has changed.

Oddly, if I manually change the wallpaper color, then refresh the screen in Regedit, I DO see the value change.

So everything is telling me this should be working, but it's not. The bold line is all I'm really concerned about.


Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")

on error resume next 'it may not exist
WSHShell.RegDelete _
    "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\Wallpaper"

On Error GoTo 0

wshShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Colors\Background", "0 0 0","REG_SZ"

来源:https://stackoverflow.com/questions/24411495/set-registry-key-for-wallpaper-solid-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!