1.

Solve : Namespace - System Folder - refresh?

Answer»

I have an application that adds an annoying System Folder to the desktop, I can easily script removing this by deleting the registry key but the TRICK I'm running into is being able to refresh the desktop so the icon disappears. If I press F5 on the keyboard the icon is gone, but I RUN this bit of VBS it doesn't WORK. So I'm wondering if anyone has a different workaround? I'd prefer not to kill EXPLORER as in many cases the systray icons don't refresh come BACK correctly. Thanks for the help.

Code: [Select]  'Option Explicit
 Dim WSHShell, strDesktop
 Set WSHShell = WScript.CreateObject("WScript.Shell")
 strDesktop = WSHShell.SpecialFolders("Desktop")
 WSHShell.AppActivate strDesktop
 WSHShell.SendKeys "{F5}"
 'WScript.Quit

 Dim Act : Set Act = CreateObject("Wscript.Shell")
  Act.SendKeys "{f5}"Have you tried this code:

Code: [Select]set oShell= createobject("shell.application")
set oDesktop = oShell.Namespace(0)
oDesktop.self.invokeVerb "R&efresh"

Or this:

Code: [Select]Set WSHShell = CreateObject("WScript.Shell")
WshShell.AppActivate "Program Manager"
WshShell.SendKeys "{F5}"
Looks like this one is the magic I needed...

Thanks.

Code: [Select]set oShell= createobject("shell.application")
set oDesktop = oShell.Namespace(0)
oDesktop.self.invokeVerb "R&efresh"



Discussion

No Comment Found