Need to combine a script to pin icons for Windows XP users and Window 7 Users. The same user would be logging into both machines. This is in a school the students have to have a locked down desktop with specific icons in the start menu. The only problem is I need it to work for each machine a user logs into. I have included the script for the window 7 and the XP.
What needs to run on a window 7 machine
Dim ObjFolder, ObjFolderItem, colVerbs, objverb, objshell
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Program Files\Internet Explorer")
Set objFolderItem = objFolder.ParseName("iexplore.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Windows\System32")
Set objFolderItem = objFolder.ParseName("Notepad.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Google\Google Earth\client")
Set objFolderItem = objFolder.ParseName("googleearth.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\SMART Technologies\Education Software")
Set objFolderItem = objFolder.ParseName("notebook.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Google\Chrome\Application")
Set objFolderItem = objFolder.ParseName("chrome.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Excel.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Winword.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Powerpnt.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
WScript.Quit
What needs to run on windows xp
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Windows\System32")
Set objFolderItem = objFolder.ParseName("Notepad.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Internet Explorer")
Set objFolderItem = objFolder.ParseName("iexplore.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Google\Chrome\Application")
Set objFolderItem = objFolder.ParseName("chrome.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Excel.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Winword.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("powerpnt.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\SMART Technologies\Education Software")
Set objFolderItem = objFolder.ParseName("Notebook.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
What needs to run on a window 7 machine
Dim ObjFolder, ObjFolderItem, colVerbs, objverb, objshell
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Program Files\Internet Explorer")
Set objFolderItem = objFolder.ParseName("iexplore.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Windows\System32")
Set objFolderItem = objFolder.ParseName("Notepad.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Google\Google Earth\client")
Set objFolderItem = objFolder.ParseName("googleearth.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\SMART Technologies\Education Software")
Set objFolderItem = objFolder.ParseName("notebook.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Google\Chrome\Application")
Set objFolderItem = objFolder.ParseName("chrome.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Excel.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Winword.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
Set objFolder = objShell.Namespace("C:\Program Files (x86)\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Powerpnt.exe")
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
Next
WScript.Quit
What needs to run on windows xp
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Windows\System32")
Set objFolderItem = objFolder.ParseName("Notepad.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Internet Explorer")
Set objFolderItem = objFolder.ParseName("iexplore.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Google\Chrome\Application")
Set objFolderItem = objFolder.ParseName("chrome.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Excel.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("Winword.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\Microsoft Office\Office14")
Set objFolderItem = objFolder.ParseName("powerpnt.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
Set objFolder = objShell.Namespace("C:\Program Files\SMART Technologies\Education Software")
Set objFolderItem = objFolder.ParseName("Notebook.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")