Hello,
I'm trying to figure out a VBScript to remove Internet Explorer from our start menu's on Windows 10.
Basically, the start menu is shut down pretty tight via GPO, but something has happened and now only "internet explorer" for whatever reason is now the only thing pinned to start.
I was hoping to throw a VBScript in the startup to by-pass this.
I am completely new to scripting so - sorry in advance for the ignorance...
Here is what I've pulled together...and it's probably pretty rough..
I am receiving an "Object required: 'objectFold' error.
Any help would be greatly appreciated!
#################################
Dim strFolder, strExecutable
strFolder = "C:\Users\%userprofile%\"
strExecutable = "internet explorer.lnk"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(strFolder)
Set objFolderItem = objFolder.ParseName(strExecutable)
'Collect Applications verbs
Set colVerbs = objFolderItem.Verbs
'Loop through the verbs and if UNPIN is found then 'DoIt' (execute)
blnOptionFound = False
For Each objVerb In colVerbs
If Replace(objVerb.name, "&", "") = "Unpin from Start" Then
objVerb.DoIt
blnOptionFound = True
WScript.Echo "The application '" & strExecutable & "' was just Unpinned from the Start Menu."
End If
Next
if blnOptionFound = false then
WScript.Echo "The application '" & strExecutable & "' failed to be unpinned from the Start Menu (may not be present)."
end if
I'm trying to figure out a VBScript to remove Internet Explorer from our start menu's on Windows 10.
Basically, the start menu is shut down pretty tight via GPO, but something has happened and now only "internet explorer" for whatever reason is now the only thing pinned to start.
I was hoping to throw a VBScript in the startup to by-pass this.
I am completely new to scripting so - sorry in advance for the ignorance...
Here is what I've pulled together...and it's probably pretty rough..
I am receiving an "Object required: 'objectFold' error.
Any help would be greatly appreciated!
#################################
Dim strFolder, strExecutable
strFolder = "C:\Users\%userprofile%\"
strExecutable = "internet explorer.lnk"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(strFolder)
Set objFolderItem = objFolder.ParseName(strExecutable)
'Collect Applications verbs
Set colVerbs = objFolderItem.Verbs
'Loop through the verbs and if UNPIN is found then 'DoIt' (execute)
blnOptionFound = False
For Each objVerb In colVerbs
If Replace(objVerb.name, "&", "") = "Unpin from Start" Then
objVerb.DoIt
blnOptionFound = True
WScript.Echo "The application '" & strExecutable & "' was just Unpinned from the Start Menu."
End If
Next
if blnOptionFound = false then
WScript.Echo "The application '" & strExecutable & "' failed to be unpinned from the Start Menu (may not be present)."
end if