Thursday, 30 July 2009

Restoring your Windows quick launch bar show desktop icon.

If you're like me you use the Windows Quick Launch bar a lot. So when you loose your Show Desktop icon it is really annoying. To restore it you need to create a new file in the Quick Launch directory. But it's also annoying when you have to google for instructions every time. And as I do weird stuff to PCs, every time can be more than once a year, and that means remembering what the file name is, or the name of the little bar thingy at the bottom of the screen, where my little clicky thing with the pencil used to be.

To solve these many problems I have have created myself a small Powershell script to do it for me.

#Create Windows XP Quicklaunch bar Show Desktop icon
#requires Powershell 1.0
$FileName = "$env:appdata\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf"
New-Item -ItemType file $fileName
Add-Content $FileName "[Shell]"
Add-Content $FileName "Command=2"
Add-Content $FileName "IconFile=explorer.exe,3"
Add-Content $FileName "[Taskbar]"
Add-Content $FileName "Command=ToggleDesktop"

And in case Brandon Shell finds this post, here's the same thing in three lines,so he doesn't taunt me, and call me a $noob. (Make sure if you cut and paste it to correct any line wrapping problems).

$FileName = "$env:appdata\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf"
$Content="[Shell]`nCommand=2`nIconFile=explorer.exe,3`n[Taskbar]`nCommand=ToggleDesktop"
Set-Content $filename $content

Of course you could collapse that down to one line

Set-Content "$env:appdata\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf" "[Shell]`nCommand=2`nIconFile=explorer.exe,3`n[Taskbar]`nCommand=ToggleDesktop"

but that's getting pretty silly isn't it.

0 comments:

Post a Comment