Showing posts with label Hkey Current User. Show all posts
Showing posts with label Hkey Current User. Show all posts

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

Friday, July 19, 2013

Set Internet Explorer Home Page using Powershell.

 

Hi,

Sometime in scripts or or in login scripts we want to set a users Internet Explorer home page to our Intranet site or to some other specific URL.

This became very handy and useful some times.

the code is below.

 

$myURL = "http://microsoft.com"
set-ItemProperty -Path 'HKCU:\Software\Microsoft\Internet Explorer\main' -Name "Start Page" -Value $myURL

In above code, we are setting a $myURL in to the registry key “HKCU:\Software\Microsoft\Internet Explorer\main”


Now lets test it.


 19-07-2013 20-45-26


i run the above code, and now my homepage should be set to “http://microsoft.com”


19-07-2013 20-46-47


wow!


Lets try one more, lets try to set google as a home page


19-07-2013 21-45-47


and let open the IE again.


Bingo ! working :)


19-07-2013 21-48-15


I hope you will like this little tweak.


and Happy weekend Guys :)


 




Thanks

Aman Dhally

 

 


clip_image001 clip_image002 clip_image003 clip_image005clip_image007