Wallpaper based on client screen resolution

Posted on 2009-12-23
Last Modified: 2012-08-29
is there any posible way to assign different wallpaper resolution by GPO based on client screen resolution setting??

like wide screen users will get the wide screen background
normal will get the normal one?
Question by:uaeabudhabi77
    LVL 13

    Expert Comment


    Author Comment

    I am trying to define a wallpaper based on screen resultion, I dont want to define screen resolution since I have defferent types and sizes of screens
    LVL 13

    Expert Comment

    i dont this you can do it with gpo

    may be script can help you

    LVL 27

    Accepted Solution

    Hi there,

    Below is a script I wrote for a previous question which can be enforced via a login script. You can modfy for the possible screen sizes and assign the required wallpaper.

    It used WMI to detect the screen size (same as link provided by NarendraG) and then assigns the require jpg in the registry, then updates the wallpaper.

    You just need to change the Select/Case section for your possible sizes and jpgs.


    Set objWMIService = GetObject("Winmgmts:\\.\root\cimv2") 
    Set objSh = CreateObject("Wscript.Shell")
    Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor where DeviceID = 'DesktopMonitor1'",,0) 
    For Each objItem in colItems 
        intHorizontal = objItem.ScreenWidth 
        intVertical = objItem.ScreenHeight 
    strResolution = CStr(intHorizontal) & " x " & CStr(intVertical)
    Select Case strResolution
    Case "1600 x 1200"
    	strWallpaperPath = "\\nsanas\applications\tony.bmp"
    Case "1024 x 768"
    	strWallpaperPath = "\\server\share\wall1024x768.bmp"
    Case "1280 x 800"
    	strWallpaperPath = "\\server\share\wall1280x800.bmp"
    Case "1280 x 1024"
    	strWallpaperPath = "\\server\share\wall1280x1024.bmp"
    Case Else
    End Select
    'Set the reg value
    objSh.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", strWallpaperPath, "REG_SZ"
    'Apply the change
    objSh.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 0, False

    Open in new window


    Expert Comment

    Hi guys,
    I used this script but had the following problem:

    Invalid use of Null: 'Cstr'

    Please, help me.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    At least once a month I see a Question in one of the Windows Server related Zones asking about Best Practices for GPO Security.  I have been in IT for 20 years, and a Sys Ad for over 15.  I know this will sound cliché, but this is mostly a preferenc…
    This is my first article in EE and english is not my mother tongue so any comments you have or any corrections you would like to make, please feel free to speak up :) For those of you working with AD, you already are very familiar with the classi…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now