Wednesday, July 24, 2013

Changing Desktop Wallpaper Positions using Powershell.

 

Hi,

Yesterday i blogged about changing Desktop background colour using Powershell.

Today we are going to change the Desktop Wallpaper Position using Powershell. Like the previous post this is again a registry tweak.

Windows Desktop wallpaper has 5 types of  Picture Position.

  1. Center
  2. Fill
  3. Fit
  4. Stretch
  5. Tile

The registry key which retains these settings is HKey_Current_User\Control Panel\Desktop and the registry key name is “WallpaperStyle

 

Setting “WallpaperStyle” reg key value
Center 0
Fit 6
Fill 10
Stretch 2
Tile 0

Lets try it :)

24-07-2013 19-13-17

I have  centrally positioned wallpaper of my daughter “Manya”  and lets changed the position to FIT one.

Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name "WallpaperStyle" -Value 6

24-07-2013 19-15-09

now log off and log-in again.

and here you go , the “Picture Position” is set to “Fit.”

24-07-2013 19-16-54

Now lets set the wallpaper position to “Fill”

Here is our code, run it,

Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name "WallpaperStyle" -Value 10

24-07-2013 19-18-00

log-off and re login again. and our “Picture Position is set to fill :)

24-07-2013 19-18-49

Now, lets set it to the “Stretch”

run the code

Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name "WallpaperStyle" -Value 2

24-07-2013 19-19-46

log-off and re-login again , and the wallpaper is set to “Stretch” now.

24-07-2013 19-20-30

if you want to set wallpaper as TILE then we have to tweak two keys. the WallpaperStyle" and “TileWallpaper"

To tile the wallpaper, we need to set “TileWallpaper" to 1

run the script code.

Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name "WallpaperStyle" -Value 0

Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name "TileWallpaper" -Value 1

24-07-2013 19-23-24 

Log-off and log-in again.

and i can see my cute bunny’s picture all over the monitor.. :) . It successfully positioned as tile.

24-07-2013 19-24-45

Okies. now lets set every thing back to normal.

I am setting wallpaper as “cantered” positioned  and tile key to off.

Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name "WallpaperStyle" -Value 0

Set-ItemProperty 'HKCU:\Control Panel\Desktop' -Name "TileWallpaper" -Value 0

24-07-2013 19-25-30

log-off and log-in again.

and you can see, there is no tile and wallpaper is centrally positioned.

24-07-2013 19-27-09

I hope that you will find it handy and helpful.

Thanks
Aman Dhally
 
 
clip_image001 clip_image002 clip_image003 clip_image005clip_image007

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.