-3

I have a VBScript file, that change wallpaper once per hour. The picture position automatically changes to Fill, but I need to set it to Fit. I can change it manually each hour, but it is better make it by command, that I could add to the VBScript.

0x0
  • 58
  • 7

1 Answers1

1

Got this code from google. See if this helps

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,

The key WallpaperStyle from HKCU\Control Panel\Desktop\Wallpaper has three values: 0 – Center; 1 – Tile; 2 - Stretch Depending on how you want the picture to be displayed, you will choose one of this options.

Mithilesh Indurkar
  • 481
  • 1
  • 5
  • 12