Solved

How do I refresh the Desktop / Start Menu in Windows 7 by script or executable?

Posted on 2011-09-12
3
1,525 Views
Last Modified: 2012-11-12
I need to force a reload of a Windows 7 Desktop and Start Menu through the use of a script or executable.  In Windows XP I did it with 3 lines of code in a vbscript


Dim objWshShell
Set objWshShell = CreateObject("WScript.Shell")
objWshShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters", 0, True


This doesn't work in Windows 7.  Does anyone have a solution?

0
Comment
Question by:CousinDupree
3 Comments
 
LVL 51

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 36526764
I think the only way to do this in Win7 is to stop and restart windows explorer. I've used a CMD script like the following for this:

@echo off
taskkill /f /im explorer.exe
del %LOCALAPPDATA%\IconCache.db /a
start explorer

Open in new window

~bp
0
 

Expert Comment

by:N0dlehs
ID: 36528303
on the same lines as billprew, but you will have to restart the machine i think after the icon cache has been restarted...


@echo off
taskkill /IM explorer.exe /F
CD /d %userprofile%\AppData\Local
DEL IconCache.db /a
shutdown /r

Open in new window

0
 

Author Closing Comment

by:CousinDupree
ID: 36532518
.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.

759 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

18 Experts available now in Live!

Get 1:1 Help Now