Saturday, August 13, 2005

VBScript tips to refresh the desktop

If you are using VBS and is deleting some shortcuts after an installation and then adding your own shortcuts you have maybe problem with having the desktop refreshed just like it automatically is when manually deleting something on the desktop. If the desktop is not refreshed the new icon will be placed after the already deleted icon, not on the same place.
Here is a tips how to do it using VBScript:
' Refresh the desktop to remove the deleted shortcuts correctly
set oShell= createobject("shell.application")
set oDesktop = oShell.Namespace(0)
oDesktop.self.invokeVerb "R&efresh"

1 comment:

  1. Restored comments
    Anonymous said...

    The "R&efresh" verb is not available in my version of shell32.dll (Windows XP).
    September 06, 2006

    JTB World said...

    I've been able to run this code on XP.
    September 06, 2006

    ReplyDelete

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner

Contact Us | About JTB World | Subscribe to this blog
JTB World's website | Website General Terms of Use | Privacy Policy
^ Top of page

© 2004- JTB World. All rights reserved.