Command Line Display Settings



Jason Ryon
07-09-2005, 11:47 PM
Does anybody know of a command line utility to change display settings, such
as screensaver and desktop background image?

Thanks,
Jason Ryon

uggabugga
07-09-2005, 11:47 PM
http://www.nirsoft.net/utils/nircmd.html

You have to download a program for this to work.
--
That's just like my opinion, Man........


"Jason Ryon" wrote:

> Does anybody know of a command line utility to change display settings, such
> as screensaver and desktop background image?
>
> Thanks,
> Jason Ryon

Torgeir Bakken \(MVP\)
07-09-2005, 11:50 PM
Jason Ryon wrote:

> Does anybody know of a command line utility to change display
> settings, such as screensaver and desktop background image?
Hi,

For the wallpaper, you can use this free command line utility:

Set Wallpaper (SetWallpaper.exe)
http://www.optimumx.com/download/


This VBScript (.vbs file) will handle both the wallpaper and
screen saver settings:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")

sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = sWinDir & "\Coffee Bean.bmp"

' update in registry
sRegKey = "HKCU\Control Panel\Desktop\"

' wallpaper setting
oShell.RegWrite sRegKey & "Wallpaper", sWallPaper

' screen saver settings
oShell.RegWrite sRegKey & "SCRNSAVE.EXE", "logon.scr", "REG_SZ"
oShell.RegWrite sRegKey & "ScreenSaverIsSecure", "1", "REG_SZ"
oShell.RegWrite sRegKey & "ScreenSaveActive", "1", "REG_SZ"
oShell.RegWrite sRegKey & "ScreenSaveTimeOut", "900", "REG_SZ"

' let the system know about the change
oShell.Run _
"%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", _
1, True
'--------------------8<----------------------


WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx


Command Line Display Settings