Windows 10“开始”菜单“布局基线”,缺少磁贴



我已经为我的windows 10部署创建了一个基线,它将开始菜单设置为默认布局。(由于一些内部政治原因,我不得不将其作为基线,所以不要问:-)

此基线创建了一个XML文件,其中包含通过Powershell从以前的"开始"菜单导出中捕获的数据。这个剧本是有效的,并且做了它应该做的事情,没有问题。但当我使用新帐户登录时,"开始"菜单缺少IE磁贴。该脚本在"%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs"处创建了缺少的快捷方式,因为我在其他几页上读到了这一点。但这种修复似乎对我不起作用。

这个脚本还删除了windows 10欢迎新用户观看的视频。

这是脚本:

$key = "SOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem"
$filecontent = @"
<LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
  <LayoutOptions StartTileGroupCellWidth="6" />
  <DefaultLayoutOverride>
    <StartLayoutCollection>
      <defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout">
        <start:Group Name="General Apps" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
          <start:Tile Size="1x1" Column="2" Row="1" AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
          <start:Tile Size="1x1" Column="3" Row="1" AppUserModelID="Microsoft.Windows.Cortana_cw5n1h2txyewy!CortanaUI" />
          <start:DesktopApplicationTile Size="1x1" Column="2" Row="0" DesktopApplicationID="Microsoft.SoftwareCenter.DesktopToasts" />
          <start:Tile Size="1x1" Column="4" Row="1" AppUserModelID="Microsoft.WindowsStore_8wekyb3d8bbwe!App" />
          <start:DesktopApplicationTile Size="1x1" Column="4" Row="0" DesktopApplicationID="{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}SnippingTool.exe" />
          <start:Tile Size="1x1" Column="5" Row="0" AppUserModelID="Microsoft.People_8wekyb3d8bbwe!x4c7a3b7dy2188y46d4ya362y19ac5a5805e5x" />
          <start:Tile Size="1x1" Column="3" Row="0" AppUserModelID="Microsoft.WindowsCalculator_8wekyb3d8bbwe!App" />
          <start:DesktopApplicationTile Size="1x1" Column="0" Row="0" DesktopApplicationID="Microsoft.InternetExplorer.Default" />
        </start:Group>
        <start:Group Name="" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
          <start:Tile Size="2x2" Column="0" Row="0" AppUserModelID="Microsoft.BingWeather_8wekyb3d8bbwe!App" />
          <start:Tile Size="2x2" Column="2" Row="0" AppUserModelID="Microsoft.BingNews_8wekyb3d8bbwe!AppexNews" />
        </start:Group>
        <start:Group Name="Remote Tools" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
          <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="Microsoft.Windows.RemoteDesktop" />
          <start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationID="Juniper.Junos Pulse.UserInterface" />
        </start:Group>
        <start:Group Name="" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
          <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="Microsoft.Office.OUTLOOK.EXE.15" />
          <start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationID="Microsoft.Office.WINWORD.EXE.15" />
          <start:DesktopApplicationTile Size="2x2" Column="4" Row="0" DesktopApplicationID="Microsoft.Office.EXCEL.EXE.15" />
          <start:DesktopApplicationTile Size="2x2" Column="0" Row="2" DesktopApplicationID="Microsoft.Office.lync.exe.15" />
          <start:DesktopApplicationTile Size="2x2" Column="2" Row="2" DesktopApplicationID="Microsoft.Office.ONENOTE.EXE.15" />
          <start:DesktopApplicationTile Size="2x2" Column="4" Row="2" DesktopApplicationID="Microsoft.Office.POWERPNT.EXE.15" />
        </start:Group>
      </defaultlayout:StartLayout>
    </StartLayoutCollection>
  </DefaultLayoutOverride>
</LayoutModificationTemplate>
"@
<# Remove Weclome Video #>
$res =  Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE$key -name EnableFirstLogonAnimation -ErrorAction SilentlyContinue
if (-not $res) 
    {New-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE$key -name EnableFirstLogonAnimation -value "0" -PropertyType "DWord"} 
else 
    {Set-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE$key -name EnableFirstLogonAnimation -value "0"}
<# Load XML Data #>
New-Item $env:ProgramDatatestingmenulayout -ItemType directory
echo $filecontent |out-file $env:ProgramDatalmcomenulayoutLayoutModification.xml
Import-StartLayout -LayoutPath $env:ProgramDatalmcomenulayoutLayoutModification.xml -MountPath $env:SystemDrive
<# Add IE Shorcut #>
$TargetFile = "C:Program FilesInternet Exploreriexplore.exe"
$ShortcutFile = "$env:ALLUSERSPROFILEMicrosoftWindowsStart MenuProgramsInternet Explorer 11.lnk"
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
$Shortcut.TargetPath = $TargetFile
$Shortcut.Save()
<# Cleanup #>
Remove-Item $env:ProgramDatatestingmenulayout -Recurse -Force

只是想知道是否有人能测试一下,看看他们是否能得到同样的结果。或者,即使有人找到了如何让失踪的瓷砖展示出来。

如果我使用类似<start:DesktopApplicationTile Size="1x1" Column="0" Row="0" DesktopApplicationID="%appdata%MicrosoftWindowsStart MenuProgramsInternet Explorer.lnk" />的东西将互动程序设置为硬链接快捷方式,我最终会完全破坏用户的启动菜单。

我还发现,偶尔当我对IE行进行更改时,Store Tile会从一开始就消失,所以我会得到一些奇怪的结果。

此外,当我在刚登录的用户上运行导出startlayout时,我可以看到startmenu xml没有丢失瓦片的记录。

我也尝试过使用实际的XML文件进行导入,手动运行这两行也得到了相同的结果。

这是脚本的最终版本。遗憾的是,最终没有使用它,但很高兴它能正常工作

    <# Detect Office Version #>
    $office2013 = (Get-ItemProperty "HKLM:SoftwareMicrosoftOffice15.0Outlook" -ErrorAction SilentlyContinue)
    $office2016 = (Get-ItemProperty "HKLM:SoftwareMicrosoftOffice16.0Outlook" -ErrorAction SilentlyContinue)
    if($office2013) {$officeversion = "2013"}
    if($office2016) {$officeversion = "2016"}
    <# Reg Values #>
    $key = "SOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem"
    <# XML Data 2016 #>
    if ($officeversion -eq 2016) {
    $filecontent = @"
    <LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
      <LayoutOptions StartTileGroupCellWidth="6" />
      <DefaultLayoutOverride>
        <StartLayoutCollection>
          <defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout">
            <start:Group Name="General Apps" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
              <start:Tile Size="1x1" Column="2" Row="1" AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
              <start:Tile Size="1x1" Column="3" Row="1" AppUserModelID="Microsoft.Windows.Cortana_cw5n1h2txyewy!CortanaUI" />
              <start:DesktopApplicationTile Size="1x1" Column="2" Row="0" DesktopApplicationID="Microsoft.SoftwareCenter.DesktopToasts" />
              <start:Tile Size="1x1" Column="4" Row="1" AppUserModelID="Microsoft.WindowsStore_8wekyb3d8bbwe!App" />
              <start:DesktopApplicationTile Size="1x1" Column="4" Row="0" DesktopApplicationID="{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}SnippingTool.exe" />
              <start:Tile Size="1x1" Column="5" Row="0" AppUserModelID="Microsoft.People_8wekyb3d8bbwe!x4c7a3b7dy2188y46d4ya362y19ac5a5805e5x" />
              <start:Tile Size="1x1" Column="3" Row="0" AppUserModelID="Microsoft.WindowsCalculator_8wekyb3d8bbwe!App" />
              <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="{6D809377-6AF0-444B-8957-A3773F02200E}Internet Exploreriexplore.exe" />
            </start:Group>
            <start:Group Name="" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
              <start:Tile Size="2x2" Column="0" Row="0" AppUserModelID="Microsoft.BingWeather_8wekyb3d8bbwe!App" />
              <start:Tile Size="2x2" Column="2" Row="0" AppUserModelID="Microsoft.BingNews_8wekyb3d8bbwe!AppexNews" />
            </start:Group>
            <start:Group Name="Remote Tools" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
              <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="Microsoft.Windows.RemoteDesktop" />
              <start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationID="Juniper.Junos Pulse.UserInterface" />
            </start:Group>
            <start:Group Name="" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
              <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="Microsoft.Office.OUTLOOK.EXE.15" />
              <start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationID="Microsoft.Office.WINWORD.EXE.15" />
              <start:DesktopApplicationTile Size="2x2" Column="4" Row="0" DesktopApplicationID="Microsoft.Office.EXCEL.EXE.15" />
              <start:DesktopApplicationTile Size="2x2" Column="0" Row="2" DesktopApplicationID="Microsoft.Office.lync.exe.15" />
              <start:DesktopApplicationTile Size="2x2" Column="2" Row="2" DesktopApplicationID="Microsoft.Office.ONENOTE.EXE.15" />
              <start:DesktopApplicationTile Size="2x2" Column="4" Row="2" DesktopApplicationID="Microsoft.Office.POWERPNT.EXE.15" />
            </start:Group>
          </defaultlayout:StartLayout>
        </StartLayoutCollection>
      </DefaultLayoutOverride>
    </LayoutModificationTemplate>
    "@
    }
    <# XML Data 2013 #>
    if ($officeversion -eq 2013) {
    $filecontent = @"
    <LayoutModificationTemplate Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
      <LayoutOptions StartTileGroupCellWidth="6" />
      <DefaultLayoutOverride>
        <StartLayoutCollection>
          <defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout">
            <start:Group Name="General Apps" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
              <start:Tile Size="1x1" Column="2" Row="1" AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
              <start:Tile Size="1x1" Column="3" Row="1" AppUserModelID="Microsoft.Windows.Cortana_cw5n1h2txyewy!CortanaUI" />
              <start:DesktopApplicationTile Size="1x1" Column="2" Row="0" DesktopApplicationID="Microsoft.SoftwareCenter.DesktopToasts" />
              <start:Tile Size="1x1" Column="4" Row="1" AppUserModelID="Microsoft.WindowsStore_8wekyb3d8bbwe!App" />
              <start:DesktopApplicationTile Size="1x1" Column="4" Row="0" DesktopApplicationID="{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}SnippingTool.exe" />
              <start:Tile Size="1x1" Column="5" Row="0" AppUserModelID="Microsoft.People_8wekyb3d8bbwe!x4c7a3b7dy2188y46d4ya362y19ac5a5805e5x" />
              <start:Tile Size="1x1" Column="3" Row="0" AppUserModelID="Microsoft.WindowsCalculator_8wekyb3d8bbwe!App" />
              <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="{6D809377-6AF0-444B-8957-A3773F02200E}Internet Exploreriexplore.exe" />
            </start:Group>
            <start:Group Name="" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
              <start:Tile Size="2x2" Column="0" Row="0" AppUserModelID="Microsoft.BingWeather_8wekyb3d8bbwe!App" />
              <start:Tile Size="2x2" Column="2" Row="0" AppUserModelID="Microsoft.BingNews_8wekyb3d8bbwe!AppexNews" />
            </start:Group>
            <start:Group Name="Remote Tools" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
              <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="Microsoft.Windows.RemoteDesktop" />
              <start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationID="Juniper.Junos Pulse.UserInterface" />
            </start:Group>
            <start:Group Name="" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
              <start:DesktopApplicationTile Size="2x2" Column="0" Row="0" DesktopApplicationID="Microsoft.Office.OUTLOOK.EXE.15" />
              <start:DesktopApplicationTile Size="2x2" Column="2" Row="0" DesktopApplicationID="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}Microsoft OfficeOffice15WINWORD.EXE" />
              <start:DesktopApplicationTile Size="2x2" Column="4" Row="0" DesktopApplicationID="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}Microsoft OfficeOffice15EXCEL.EXE" />
              <start:DesktopApplicationTile Size="2x2" Column="0" Row="2" DesktopApplicationID="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}Microsoft OfficeOffice15lync.exe" />
              <start:DesktopApplicationTile Size="2x2" Column="4" Row="2" DesktopApplicationID="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}Microsoft OfficeOffice15POWERPNT.EXE" />
              <start:DesktopApplicationTile Size="2x2" Column="2" Row="2" DesktopApplicationID="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}Microsoft OfficeOffice15ONENOTE.EXE" />
            </start:Group>
          </defaultlayout:StartLayout>
        </StartLayoutCollection>
      </DefaultLayoutOverride>
    </LayoutModificationTemplate>
    "@
    }
    <# Remove Weclome Video #>
    $res =  Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE$key -name EnableFirstLogonAnimation -ErrorAction SilentlyContinue
    if (-not $res) 
        {New-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE$key -name EnableFirstLogonAnimation -value "0" -PropertyType "DWord"} 
    else 
        {Set-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE$key -name EnableFirstLogonAnimation -value "0"}
    <# Load XML Data #>
    $folderexist = (test-path $env:ProgramDatalmco)
    if ($folderexist) 
        {New-Item $env:ProgramDatalmcomenulayout -ItemType directory}
    else
        {New-Item $env:ProgramDataLMCO -ItemType directory; New-Item $env:ProgramDatalmcomenulayout -ItemType directory}
    echo $filecontent |out-file $env:ProgramDatalmcomenulayoutLayoutModification.xml
    Import-StartLayout -LayoutPath $env:ProgramDatalmcomenulayoutLayoutModification.xml -MountPath $env:SystemDrive
    <# Add IE Shorcut #>
    $TargetFile = "C:Program FilesInternet Exploreriexplore.exe"
    $ShortcutFile = "$env:ALLUSERSPROFILEMicrosoftWindowsStart MenuProgramsInternet Explorer.lnk"
    $WScriptShell = New-Object -ComObject WScript.Shell
    $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
    $Shortcut.TargetPath = $TargetFile
    $Shortcut.Save()
    <# Cleanup #>
    Remove-Item $env:ProgramDatalmcomenulayout -Recurse -Force

我自己在一个应用程序中遇到了一些IE问题。据我所知,Microsoft.InternetExplorer.Default似乎不起作用,虽然一些指南说Microsoft.Explorer.DDefault适用于IE,但这要追溯到一篇科技网原创文章中的拼写错误。我使用一个捕获的非通用AppID()使其工作

{6D809377-6AF0-444B-8957-A3773F02200E}\Internet Explorer\explore.exe

用于64位和

{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}\Internet Explorer\explore.exe

用于32Bit。您可以使用Powershell命令"GetStartApps"为所有可能的程序获取此ID,因此:

GetStartApps|where{$_.Name-ilike‘InternetExplorer*’}

只要IE坏了。正如您在这里看到的,这些是ProgramFilesx64和x86文件夹的GUID。ProgramFiles也有一个通用的程序文件({905E63B6-C1BF-494E-B29C-65B732D3D21A}),但由于它没有与Get-StartApps一起列出,它可能不起作用。

然而,首先,这个解决方案不能在x64和x86窗口中使用一个文件,其次,在我看来,它可能会在某个时候崩溃。这不太可能,因为ID是存在的,因为vista和更改GUID会破坏很多兼容性,但只要有其他选择,我还是不愿意依赖更模糊的方法。

因此,我选择了lnk文件的解决方案。但是,如果这样做,则不能再使用DesktopApplicationID,而是使用DesktopApplicationLinkPath。正确的语法应该是:

<start:DesktopApplicationTile Size="1x1" Column="0" Row="0" DesktopApplicationLinkPath="%APPDATA%MicrosoftWindowsStart MenuProgramsInternet Explorer.lnk" />

相关内容

  • 没有找到相关文章

最新更新