Solved

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

Posted on 2011-09-12
3
1,695 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 55

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

691 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