Powershell VBscript无法将项目固定到Windows Insider build上的任务栏
我有一个脚本,可以将一个项目固定到除Windows Insider版本之外的所有操作系统的任务栏上。我将其转换为Powershell脚本,它也适用于除Windows Insider版本之外的所有操作系统。当我运行它时,我没有收到任何错误消息,事件查看器中没有任何内容。MS已经锁定了通过编程将项目固定到“开始”菜单和任务栏的功能。看起来他们在即将发布的版本中会走得更远。还有其他人碰到过这个吗?这是我正在使用的代码Powershell VBscript无法将项目固定到Windows Insider build上的任务栏,powershell,vbscript,Powershell,Vbscript,我有一个脚本,可以将一个项目固定到除Windows Insider版本之外的所有操作系统的任务栏上。我将其转换为Powershell脚本,它也适用于除Windows Insider版本之外的所有操作系统。当我运行它时,我没有收到任何错误消息,事件查看器中没有任何内容。MS已经锁定了通过编程将项目固定到“开始”菜单和任务栏的功能。看起来他们在即将发布的版本中会走得更远。还有其他人碰到过这个吗?这是我正在使用的代码 Function PinItem(strFolder, strFile)
Function PinItem(strFolder, strFile)
Dim ShortcutPath
Dim sKey1
Dim sKey2
Dim KeyValue
'----------------------------------------------------------------------
Set objFSO = CreateObject("Scripting.FileSystemObject")
ShortcutPath = strFolder & "\" & strFile
sKey1 = "HKCU\Software\Classes\*\shell\{:}\\"
sKey2 = Replace(sKey1, "\\", "\ExplorerCommandHandler")
'----------------------------------------------------------------------
With WScript.CreateObject("WScript.Shell")
KeyValue = .RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" & _
"\CommandStore\shell\Windows.taskbarpin\ExplorerCommandHandler")
.RegWrite sKey2, KeyValue, "REG_SZ"
With WScript.CreateObject("Shell.Application")
With .Namespace(objFSO.GetParentFolderName(ShortcutPath))
With .ParseName(objFSO.GetFileName(ShortcutPath))
.InvokeVerb("{:}")
End With
End With
End With
.Run("Reg.exe delete """ & Replace(sKey1, "\\", "") & """ /F"), 0, True
End With
End Function