在bat文件中将xp桌面背景更改为默认值

时间:2013-01-11 14:52:12

标签: batch-file

我在xp中有一个destkop背景。我想运行一个批处理文件,它将我当前的背景更改为默认值None,它只是一种纯色。如果有人有一个例子会很棒。

感谢

1 个答案:

答案 0 :(得分:0)

我最终放弃了这个想法,因为在我找到了另一个问题之后我并不需要它,但我确实找到了一个我记不起来的好网站,它提供了使用vbscript读取和编写注册表项的示例。我能够在我的桌面上安装一些壁纸并将此vbscript放入我的启动中,以便将壁纸恢复为“无”纯色样式。它看起来像这样

Option Explicit

Dim SysVarReg, Value, NewValue

Set SysVarReg = WScript.CreateObject("WScript.Shell")

' Read current value of desktop wallpaper
value = SysVarReg.RegRead ("HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper")

' Display to screen for testing
'MsgBox(value)


NewValue = ""

' Reset the value of the wallpaper to an empty string for the default no wallpaper
SysVarReg.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper", NewValue

' Display to screen again for testing
'MsgBox(NewValue)