vbs更改并刷新壁纸

时间:2013-11-05 07:00:36

标签: vbscript wallpaper

我的老板要求我从http下载jpg文件并定期将其更改为壁纸,这是我的代码

dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", "http://defsite.com/wallpaper/wallpaper.jpg", False
xHttp.Send

with bStrm
.type = 1 '//binary
.open
.write xHttp.responseBody
.savetofile "C:\Documents and Settings\Administrator\My Documents\My Pictures\Wallpaper\wallpaper.jpg", 2 '//overwrite
end with

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\windows\system32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
但是,WshShell.Run无法在屏幕上更新,操作系统是XP。有什么想法吗?

请咨询!

0 个答案:

没有答案
相关问题