我有一个VBScript文件,每小时更换一次壁纸。 图片位置自动更改为“填充”,但我需要将其设置为“适合”。我可以每小时手动更改它,但最好通过命令,我可以添加到VBScript。
答案 0 :(得分:0)
从谷歌获得此代码。看看这是否有帮助
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "C:\winnt.bmp"
' update in registry oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper",sWallPaper
' let the system know about the change oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,
来自HKCU \ Control Panel \ Desktop \ Wallpaper的关键WallpaperStyle有三个值:0 - Center; 1 - 平铺; 2 - 伸展 根据您希望图片的显示方式,您可以选择其中一个选项。