Prev: Script to delete millions of files
Next: How to copy large data from one excel to another using VBScript
From: CaptHowdy314 on 8 Dec 2009 16:06 Hello All, I tried posting to the VB forum on MSDN and someone suggested I post here instead. I am not a VBScript programmer by any means, but as I understand it, it is about the only way to achieve what I want. I manage a small network of computers and need a couple scripts to dictate what is pinned to the Start Menu (or taskbar as I will be running Windows 7 shortly, currently Vista). I have been able to figure out how to pin programs (thanks to a post by The Development Guys ) but I am unable to figure out how to unpin Internet Explorer. I would appreciate any help anyone may be able to provide. Below is the main script I am using. Thanks! Const KNOWNFOLDERID_COMMON_PROGRAMS = &H17 Const KNOWNFOLDERID_PROGRAMS = &H2 Set objShell = CreateObject("Shell.Application") Set objAllUsersProgramsFolder = objShell.NameSpace(KNOWNFOLDERID_COMMON_PROGRAMS) strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path Set objFolder = objShell.Namespace(strAllUsersProgramsPath & "\Microsoft Office") Set objFolderItem = objFolder.ParseName("Microsoft Office Word 2007.lnk") Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt Next Set objShell = CreateObject("Shell.Application") Set objAllUsersProgramsFolder = objShell.NameSpace(KNOWNFOLDERID_COMMON_PROGRAMS) strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path Set objFolder = objShell.Namespace(strAllUsersProgramsPath & "\Microsoft Office") Set objFolderItem = objFolder.ParseName("Microsoft Office Excel 2007.lnk") Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt Next Set objShell = CreateObject("Shell.Application") Set objAllUsersProgramsFolder = objShell.NameSpace(KNOWNFOLDERID_COMMON_PROGRAMS) strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path Set objFolder = objShell.Namespace(strAllUsersProgramsPath & "\Microsoft Office") Set objFolderItem = objFolder.ParseName("Microsoft Office PowerPoint 2007.lnk") Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt Next Set objShell = CreateObject("Shell.Application") Set objAllUsersProgramsFolder = objShell.NameSpace(KNOWNFOLDERID_COMMON_PROGRAMS) strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path Set objFolder = objShell.Namespace(strAllUsersProgramsPath & "\Microsoft Office") Set objFolderItem = objFolder.ParseName("Microsoft Office Publisher 2007.lnk") Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt Next Set objShell = CreateObject("Shell.Application") Set objAllUsersProgramsFolder = objShell.NameSpace(KNOWNFOLDERID_COMMON_PROGRAMS) strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path Set objFolder = objShell.Namespace(strAllUsersProgramsPath & "\Microsoft Office") Set objFolderItem = objFolder.ParseName("Microsoft Office FrontPage 2003.lnk") Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt Next |