'==================================================== '==================================================== 'Make the (first) selected image wallpaper 'by Elsa Nordh ' 'This script uses IrfanView to set the wallpaper. 'I've used version 3.98. Use at your own risk ;-) '==================================================== '==================================================== 'you might need to change the location of irfan view. Dim IrfanView, GetScreenRes IrfanView = "C:\program\IrfanView\i_view32.exe" '==================================================== 'set some useful variables Dim iViewApp, iViewCat, strRet Set iViewApp = CreateObject("iView.Application") Set iViewCat = iViewApp.ActiveCatalog 'read catalog selection For Each MediaItm In iViewCat.Selection fileName = MediaItm.Path exit for Next 'create new file (fitted to screen size) dim height, width Dim objShell, args, tmp, newFileName Set objShell = CreateObject("WScript.Shell") Set objWMIService = GetObject("Winmgmts:\\.\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor where DeviceID = 'DesktopMonitor1'",,0) For Each objItem in colItems width = objItem.ScreenWidth height = objItem.ScreenHeight Next 'resize the image and keep aspect ratio. Save it as oldfilename_screen.extension (IMG_4605.jpg would be saved as IMG_4605_screen.jpg) newFileName = left(fileName, len(fileName)-4) & "_screen." & right(filename, 3) args = """" & fileName & """ /resize=(" & width & ", " & height & ") /aspectratio /jpgq=80 /convert=" & """" & newFileName & """" & " /one" tmp = IrfanView & " " & args objShell.Run tmp, 0, true 'make new pic wallpaper args = newFileName & " /wall=0 /killmesoftly" tmp = IrfanView & " " & args objShell.Run tmp 'syntax for irfanviews wallpaper maker: i_view32.exe c:\test.jpg /wall=X 'X options '0 centered '1 tiled '2 stretched