Jump to content

Refresh Desktop problem "sort of"


Recommended Posts

I am writing up a script to redirect all of a users browser shortcuts through the MSDN app DropMyRights in an attempt to better protect the systems.

Part of this script is to remove the IE Icon from the desktop. this is accomplished by setting this registry key.

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer", "NoInternetIcon", "REG_DWORD", 1)

I then create a new IE shortcut on the desktop which is redirected through DropMyRights.

The issue, is that the IE Icon does not go away until a log off and log on. I tried the EnvUpdate() and that didn't work. Doing an F5 also doesn't work.

Does anyone have an idea on how I can get that IE Icon to go away without have to have the user reboot?

Thanks,

Mike

Link to comment
Share on other sites

try Run()ning this...

RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters

Lar.

ps... OR...

http://www.autoitscript.com/forum/index.php?showtopic=108929&view=findpost&p=767100

Edited by LarryDalooza

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Link to comment
Share on other sites

try Run()ning this...

RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters

Lar.

ps... OR...

http://www.autoitscript.com/forum/index.php?showtopic=108929&view=findpost&p=767100

I tried the RunDLL32 and the _Update_Explorer() function from that link and neither of them worked. Googling that User32.dll I found a link about policy update, so I tried gpupdate.exe /force but that didn't work either.

I also found a note saying HKLM policies do not update until logon, so I changed to the HKCU which only effects the logged on user and I still can't get it to refresh and remove the icon from the desktop without the logoff.

hmm...

EDIT: I found that ending task on Explorer.exe and then relaunching as a new task got it to remove the IE icon. Would it be a bad thing to do this in the script?

Edited by MikeOsdx
Link to comment
Share on other sites

Am guessing sending an F5 (refresh desktop) doesn't do the trick?

RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", 1)
RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", 1)

How about after these registry mods?

Link to comment
Share on other sites

Am guessing sending an F5 (refresh desktop) doesn't do the trick?

RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", 1)
RegWrite ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", 1)

How about after these registry mods?

Excellent, using those two registry keys along with the _Update_Explorer() function in the other post got it to update instantly.

Thank you Larry and Spiff59

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...