本文介绍了在任务栏上移除谷歌Chrome固定图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除任务栏上的谷歌浏览器固定图标。卸载不会删除图标。我修改code只删除了谷歌Chrome.lnk。我想要做的(寂寂VBS)是遍历所有用户文件夹不只是这是我相信定义为 strCurrentUserAppData 当前用户。其他的愿望,我想这个code做的是利用它与SCCM做一个干净的安装Chrome浏览器。我安装x64版本和需要x86版本来替换它。当我使用企业MSI做卸载它留下的固定图标。如果我用一只蝙蝠从目录中删除图标,该LNK被删除,但有留在任务栏上的白皮书图标。到目前为止,这是唯一的code上取下固定图标的作品。

 显式的选项常量CSIDL_APPDATA =安培; H1A昏暗objShell
昏暗objFolder
昏暗objFolderItem
昏暗objVerb
昏暗objCurrentUserAppData
昏暗strCurrentUserAppData
设置objShell =的CreateObject(Shell.Application)
设置objCurrentUserAppData = objShell.NameSpace(CSIDL_APPDATA)
strCurrentUserAppData = objCurrentUserAppData.Self.Path==================='===================
' - 删除所有固定项目 -
==================='===================
设置objFolder = objShell.Namespace(strCurrentUserAppData&安培;\\微软\\的Internet Explorer \\快速启动\\用户已固定\\任务)
对于每个objFolderItem在objFolder.Items
    WScript.Echo objFolderItem
    如果objFolderItem =谷歌浏览器,然后
        对于objFolderItem.Verbs每个objVerb
            如果更换(objVerb.name,与&,)=取消固定任务栏,从接着objVerb.DoIt
        下一个
    万一
下一个

批次code我还有运行甚至不会重启后删除图标。

  TASKKILL / IM的chrome.exe / F / T
TASKKILL / IM有GoogleUpdate.exe / F / T
TASKKILL / IM GoogleCrashHandler.exe / F / T
TASKKILL / IM GoogleCrashHandler64.exe / F / T
TASKKILL / IM GoogleUpdateBroker.exe / F / T
TASKKILL / IM GoogleUpdateHelper.msi / F / T
TASKKILL / IM GoogleUpdateOnDemand.exe / F / T
TASKKILL / IM GoogleUpdateSetup.exe / F / T
TASKKILL / IM chrmstp.exe / F / T在msiexec.exe / x {3EDA268B-C905-37D1-89DF-7049B39FB069} / Q / N在msiexec.exe / x {6A21C1E8-DAC1-3C18-BCDC-2DBB4B352AD8} / Q / NREM应用程序文件
第三届%USERPROFILE%\\应用程序数据\\本地\\谷歌/ S / Q
RDC:\\用户\\ DEFAULT \\应用程序数据\\本地\\谷歌/ S / Q
RD\\谷歌/ S / Q
RD为%ProgramFiles%\\谷歌/ S / Q
RD为%ProgramFiles(x86)的%\\谷歌/ S / QREM桌面shorcuts
德尔%的公众%\\桌面\\谷歌Chrome.lnk/ Q
德尔%USERPROFILE%\\桌面\\谷歌Chrome.lnk/ QREM开始菜单文件夹
第三届%PROGRAMDATA%\\微软\\ WINDOWS \\开始菜单\\程序\\谷歌浏览器/ S / Q
第三届%USERPROFILE%\\应用程序数据\\漫游\\微软\\ WINDOWS \\开始菜单\\程序\\谷歌浏览器/ S / QREM固定的项目
德尔%USERPROFILE%\\应用程序数据\\漫游\\微软\\的Internet Explorer \\快速启动\\谷歌浏览器* .LNK/ Q
德尔%USERPROFILE%\\应用程序数据\\漫游\\微软\\的Internet Explorer \\快速启动\\用户已固定\\任务\\谷歌浏览器* .LNK/ QTASKKILL / F / IM的explorer.exe
启动Explorer.exe


解决方案

尝试这种混合code(VBScript中/ PowerShell中):

 显式的选项
暗淡标题,WS,ByPassPSFile,APPPATH,比如psfile中,MyCmd,结果,MYARRAY,MyApp的,FOLDERPATH,FSO
标题=从任务栏上的Windows 7通过Hackoo取消固定应用
Ws中设置= CREATEOBJECT(wscript.Shell)
FSO设置=的CreateObject(Scripting.FileSystemObject的)
psfile中=左(Wscript.ScriptFullName,InstrRev(Wscript.ScriptFullName,))及PS1
ByPassPSFile =CMD / K PowerShell.exe -ExecutionPolicy旁路-noprofile -file
示例=C:\\ Program Files文件\\谷歌\\铬\\应用\\的chrome.exe
APPPATH =输入框(AMP,以从任务栏取消固定它进入您的应用程序的路径; VBCR&安培;例如:&放大器; VBCR&安培; Dblquote(实例)及,标题,例)
如果APPPATH =或为IsEmpty(APPPATH)然后Wscript.Quit()
MYARRAY =斯普利特(APPPATH,\\)
MyApp的MYARRAY =(UBound函数(MYARRAY))
FOLDERPATH = fso.GetParentFolderName(APPPATH)
MyCmd =$ SA =新对象-c shell.application&放大器; VbCrlF
MyCmd = MyCmd&安培; $ FOLDERPATH =与& DblQuote(FOLDERPATH)及VbCrlF
MyCmd = MyCmd&安培; $ PN = $ sa.namespace($ FOLDERPATH).parsename('与& MyApp的&放大器;')与& VbCrlF
MyCmd = MyCmd&安培; $ pn.invokeverb('taskbarunpin')
呼叫WriteMyPSFile(MyCmd)
结果= Ws.run(ByPassPSFile&安培; psfile中,1,真)
******************* *********************************************
子WriteMyPSFile(strText中)
昏暗的FS,TS,psfile中
常量ForWriting = 2
    psfile中=左(Wscript.ScriptFullName,InstrRev(Wscript.ScriptFullName,))及PS1
    组FS =的CreateObject(Scripting.FileSystemObject的)
    设置TS = fs.OpenTextFile(psfile中,ForWriting,真)
    ts.WriteLine strText的
    ts.Close
结束小组
******************* *********************************************
功能DblQuote(STR)
    DblQuote = CHR(34)及STR和放大器;字符(34)
结束功能
******************* *********************************************

编辑:22/06/2015:UnPinfromTaskBarHiddenConsole.vbs

 显式的选项
暗淡标题,WS,ByPassPSFile,APPPATH,比如psfile中,MyCmd,结果,MYARRAY,MyApp的,FOLDERPATH,FSO
标题=从任务栏上的Windows 7通过Hackoo取消固定应用
Ws中设置= CREATEOBJECT(wscript.Shell)
FSO设置=的CreateObject(Scripting.FileSystemObject的)
psfile中=左(Wscript.ScriptFullName,InstrRev(Wscript.ScriptFullName,))及PS1
ByPassPSFile =CMD / C PowerShell.exe -ExecutionPolicy旁路-noprofile -file
示例=C:\\ Program Files文件\\谷歌\\铬\\应用\\的chrome.exe
APPPATH =输入框(AMP,以从任务栏取消固定它进入您的应用程序的路径; VBCR&安培;例如:&放大器; VBCR&安培; Dblquote(实例)及,标题,例)
如果APPPATH =或为IsEmpty(APPPATH)然后Wscript.Quit()
MYARRAY =斯普利特(APPPATH,\\)
MyApp的MYARRAY =(UBound函数(MYARRAY))
FOLDERPATH = fso.GetParentFolderName(APPPATH)
MyCmd =$ SA =新对象-c shell.application&放大器; VbCrlF
MyCmd = MyCmd&安培; $ FOLDERPATH =与& DblQuote(FOLDERPATH)及VbCrlF
MyCmd = MyCmd&安培; $ PN = $ sa.namespace($ FOLDERPATH).parsename('与& MyApp的&放大器;')与& VbCrlF
MyCmd = MyCmd&安培; $ pn.invokeverb('taskbarunpin')
呼叫WriteMyPSFile(MyCmd)
结果= Ws.run(ByPassPSFile&安培; psfile中,0,真)
MSGBOX&AMP的取消固定; DblQuote(MyApp的)及从任务栏完成!,VbInformation,标题
******************* *********************************************
子WriteMyPSFile(strText中)
昏暗的FS,TS,psfile中
常量ForWriting = 2
    psfile中=左(Wscript.ScriptFullName,InstrRev(Wscript.ScriptFullName,))及PS1
    组FS =的CreateObject(Scripting.FileSystemObject的)
    设置TS = fs.OpenTextFile(psfile中,ForWriting,真)
    ts.WriteLine strText的
    ts.Close
结束小组
******************* *********************************************
功能DblQuote(STR)
    DblQuote = CHR(34)及STR和放大器;字符(34)
结束功能
******************* *********************************************

I want to remove the Google Chrome pinned icon on the taskbar. The uninstall does NOT remove the icon. I modified code to remove just the Google Chrome.lnk. What I want to do (knowing about VBS) is to loop through all the user folders not just the current user which is I believe defined as strCurrentUserAppData. The other desire I would like to do with this code is to use it with SCCM to do a clean install of Chrome. I installed the x64 version and need to replace it with the x86 version. When I do the uninstall using the enterprise MSI it leaves the pinned icon. If I use a bat to remove the icon from the directory, the lnk is deleted but there is left a white paper icon on the task bar. So far this is the only code that works on removing the pinned icon.

Option Explicit

Const CSIDL_APPDATA = &H1A

Dim objShell
Dim objFolder
Dim objFolderItem
Dim objVerb
Dim objCurrentUserAppData
Dim strCurrentUserAppData
Set objShell = CreateObject("Shell.Application")
Set objCurrentUserAppData = objShell.NameSpace(CSIDL_APPDATA)
strCurrentUserAppData = objCurrentUserAppData.Self.Path



'===================''==================='
' - Remove All Pinned Items -
'===================''==================='


Set objFolder = objShell.Namespace(strCurrentUserAppData & "\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar")


For Each objFolderItem in objFolder.Items
    'WScript.Echo objFolderItem
    If objFolderItem = "Google Chrome" then
        For Each objVerb in objFolderItem.Verbs
            If Replace(objVerb.name, "&", "") = "Unpin from Taskbar" Then objVerb.DoIt
        Next
    End if
Next

The BATCH Code I have run still will not remove the icon even after rebooting.

taskkill /im chrome.exe /f /t
taskkill /im GoogleUpdate.exe /f /t
taskkill /im GoogleCrashHandler.exe /f /t
taskkill /im GoogleCrashHandler64.exe /f /t
taskkill /im GoogleUpdateBroker.exe /f /t
taskkill /im GoogleUpdateHelper.msi /f /t
taskkill /im GoogleUpdateOnDemand.exe /f /t
taskkill /im GoogleUpdateSetup.exe /f /t
taskkill /im chrmstp.exe /f /t

MsiExec.exe /X{3EDA268B-C905-37D1-89DF-7049B39FB069} /q/n

MsiExec.exe /X{6A21C1E8-DAC1-3C18-BCDC-2DBB4B352AD8} /q/n

rem app files
rd "%userprofile%\AppData\Local\Google" /s/q
rd "C:\Users\Default\AppData\Local\Google" /s/q
rd "\Google" /s/q
rd "%PROGRAMFILES%\Google" /s/q
rd "%PROGRAMFILES(X86)%\Google" /s/q

rem desktop shorcuts
del "%PUBLIC%\Desktop\Google Chrome.lnk" /q
del "%userprofile%\Desktop\Google Chrome.lnk" /q

rem start menu folders
rd "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Google Chrome" /s/q
rd "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Google Chrome" /s/q

rem pinned items
del "%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Google Chrome*.lnk" /q
del "%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Google Chrome*.lnk" /q

taskkill /f /im explorer.exe
start explorer.exe
解决方案

Try this hybrid code (Vbscript/PowerShell):

Option Explicit
Dim Title,Ws,ByPassPSFile,AppPath,Example,PSFile,MyCmd,Result,MyArray,MyApp,FolderPath,fso
Title = "UnPin application from Taskbar on Windows 7 by Hackoo"
Set Ws = CreateObject("wscript.Shell")
Set fso = Createobject("Scripting.FileSystemObject")
PSFile = Left(Wscript.ScriptFullName, InstrRev(Wscript.ScriptFullName, ".")) & "ps1"
ByPassPSFile = "cmd /k PowerShell.exe -ExecutionPolicy bypass -noprofile -file "
Example = "C:\Program Files\Google\Chrome\Application\Chrome.exe "
AppPath = InputBox("Enter the path of your application in order to unpin it from the taskbar " & vbcr & "Example : " & vbcr & Dblquote(Example) & "",Title,Example)
If AppPath = "" or IsEmpty(AppPath) Then Wscript.Quit()
MyArray = Split(AppPath,"\")
MyApp = MyArray(UBound(MyArray))
FolderPath = fso.GetParentFolderName(AppPath)
MyCmd = "$sa = new-object -c shell.application" & VbCrlF
MyCmd = MyCmd & "$FolderPath = "& DblQuote(FolderPath) & VbCrlF
MyCmd = MyCmd & "$pn = $sa.namespace($FolderPath).parsename('"& MyApp &"')" & VbCrlF
MyCmd = MyCmd & "$pn.invokeverb('taskbarunpin')"
Call WriteMyPSFile(MyCmd)
Result = Ws.run(ByPassPSFile & PSFile,1,True)
'**********************************************************************************************
Sub WriteMyPSFile(strText)
Dim fs,ts,PSFile
Const ForWriting = 2
    PSFile = Left(Wscript.ScriptFullName, InstrRev(Wscript.ScriptFullName, ".")) & "ps1"
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set ts = fs.OpenTextFile(PSFile,ForWriting,True)
    ts.WriteLine strText
    ts.Close
End Sub
'**********************************************************************************************
Function DblQuote(Str)
    DblQuote = Chr(34) & Str & Chr(34)
End Function
'**********************************************************************************************

EDIT : 22/06/2015 : UnPinfromTaskBarHiddenConsole.vbs

Option Explicit
Dim Title,Ws,ByPassPSFile,AppPath,Example,PSFile,MyCmd,Result,MyArray,MyApp,FolderPath,fso
Title = "UnPin application from Taskbar on Windows 7 by Hackoo"
Set Ws = CreateObject("wscript.Shell")
Set fso = Createobject("Scripting.FileSystemObject")
PSFile = Left(Wscript.ScriptFullName, InstrRev(Wscript.ScriptFullName, ".")) & "ps1"
ByPassPSFile = "cmd /c PowerShell.exe -ExecutionPolicy bypass -noprofile -file "
Example = "C:\Program Files\Google\Chrome\Application\Chrome.exe "
AppPath = InputBox("Enter the path of your application in order to unpin it from the taskbar " & vbcr & "Example : " & vbcr & Dblquote(Example) & "",Title,Example)
If AppPath = "" or IsEmpty(AppPath) Then Wscript.Quit()
MyArray = Split(AppPath,"\")
MyApp = MyArray(UBound(MyArray))
FolderPath = fso.GetParentFolderName(AppPath)
MyCmd = "$sa = new-object -c shell.application" & VbCrlF
MyCmd = MyCmd & "$FolderPath = "& DblQuote(FolderPath) & VbCrlF
MyCmd = MyCmd & "$pn = $sa.namespace($FolderPath).parsename('"& MyApp &"')" & VbCrlF
MyCmd = MyCmd & "$pn.invokeverb('taskbarunpin')"
Call WriteMyPSFile(MyCmd)
Result = Ws.run(ByPassPSFile & PSFile,0,True)
MsgBox "The Unpin of " & DblQuote(MyApp) & " from the taskbar is done !",VbInformation,Title
'**********************************************************************************************
Sub WriteMyPSFile(strText)
Dim fs,ts,PSFile
Const ForWriting = 2
    PSFile = Left(Wscript.ScriptFullName, InstrRev(Wscript.ScriptFullName, ".")) & "ps1"
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set ts = fs.OpenTextFile(PSFile,ForWriting,True)
    ts.WriteLine strText
    ts.Close
End Sub
'**********************************************************************************************
Function DblQuote(Str)
    DblQuote = Chr(34) & Str & Chr(34)
End Function
'**********************************************************************************************

这篇关于在任务栏上移除谷歌Chrome固定图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 01:34