[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[系统相关] 请教大虾们,用什么命令才能导入联机映像默认应用程序关联

装完系统每次都要手动设置应用程序关联,而且右下角经常弹出“已重置默认xx”,烦得要死,Dism++里有个功能如下图标注,可以恢复自定义的默认应用程序关联,立即生效。所以想请教一下,用什么批处理命令才能实现这个功能(肯定不是Dism /Online /Import-DefaultAppAssociations:"D:\AppAssoc.xml"这条命令),我想做成BAT文件让它在装完系统的第一次进入桌面时自动执行并删除自己。

我导出的AppAssoc.xml文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<DefaultAssociations>
  <Association Identifier=".3g2" ProgId="PotPlayerMini64.3G2" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".3gp" ProgId="PotPlayerMini64.3GP" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".3gp2" ProgId="PotPlayerMini64.3GP2" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".3gpp" ProgId="PotPlayerMini64.3GPP" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".ani" ProgId="ACDSee Ultimate 2019.ani" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".arw" ProgId="ACDSee Ultimate 2019.arw" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".asf" ProgId="PotPlayerMini64.ASF" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".ASS" ProgId="PotPlayerMini64.ASS" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".asx" ProgId="PotPlayerMini64.ASX" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".avi" ProgId="PotPlayerMini64.AVI" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".bmp" ProgId="ACDSee Ultimate 2019.bmp" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".CR2" ProgId="ACDSee Ultimate 2019.cr2" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".crw" ProgId="ACDSee Ultimate 2019.crw" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".dcx" ProgId="ACDSee Ultimate 2019.dcx" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".dib" ProgId="ACDSee Ultimate 2019.dib" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".dng" ProgId="ACDSee Ultimate 2019.dng" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".emf" ProgId="ACDSee Ultimate 2019.emf" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".erf" ProgId="ACDSee Ultimate 2019.erf" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".gif" ProgId="ACDSee Ultimate 2019.gif" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".heic" ProgId="ACDSee Ultimate 2019.heic" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".heif" ProgId="ACDSee Ultimate 2019.heif" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".htm" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier=".html" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier=".ico" ProgId="ACDSee Ultimate 2019.ico" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".idx" ProgId="PotPlayerMini64.IDX" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".jfif" ProgId="ACDSee Ultimate 2019.jfif" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".jif" ProgId="ACDSee Ultimate 2019.jif" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".jpc" ProgId="ACDSee Ultimate 2019.jpc" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".jpe" ProgId="ACDSee Ultimate 2019.jpe" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".jpeg" ProgId="ACDSee Ultimate 2019.jpeg" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".jpg" ProgId="ACDSee Ultimate 2019.jpg" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".kdc" ProgId="ACDSee Ultimate 2019.kdc" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".m1v" ProgId="PotPlayerMini64.M1V" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".m2t" ProgId="PotPlayerMini64.M2T" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".m2ts" ProgId="PotPlayerMini64.M2TS" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".m4v" ProgId="PotPlayerMini64.M4V" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mkv" ProgId="PotPlayerMini64.MKV" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mov" ProgId="PotPlayerMini64.MOV" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mp2v" ProgId="PotPlayerMini64.MP2V" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mp4" ProgId="PotPlayerMini64.MP4" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mpa" ProgId="PotPlayerMini64.MPA" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".MPE" ProgId="PotPlayerMini64.MPE" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mpeg" ProgId="PotPlayerMini64.MPEG" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mpg" ProgId="PotPlayerMini64.MPG" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mpv2" ProgId="PotPlayerMini64.MPV2" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".mrw" ProgId="ACDSee Ultimate 2019.mrw" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".mts" ProgId="PotPlayerMini64.MTS" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".NEF" ProgId="ACDSee Ultimate 2019.nef" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".nrw" ProgId="ACDSee Ultimate 2019.nrw" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".orf" ProgId="ACDSee Ultimate 2019.orf" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".pct" ProgId="ACDSee Ultimate 2019.pct" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".pcx" ProgId="ACDSee Ultimate 2019.pcx" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".pef" ProgId="ACDSee Ultimate 2019.pef" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".pic" ProgId="ACDSee Ultimate 2019.pic" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".png" ProgId="ACDSee Ultimate 2019.png" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".psd" ProgId="ACDSee Ultimate 2019.psd" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".QT" ProgId="PotPlayerMini64.QT" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".raf" ProgId="ACDSee Ultimate 2019.raf" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".raw" ProgId="ACDSee Ultimate 2019.raw" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".rle" ProgId="ACDSee Ultimate 2019.rle" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".rw2" ProgId="ACDSee Ultimate 2019.rw2" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".rwl" ProgId="ACDSee Ultimate 2019.rwl" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".sr2" ProgId="ACDSee Ultimate 2019.sr2" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".SRT" ProgId="PotPlayerMini64.SRT" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".srw" ProgId="ACDSee Ultimate 2019.srw" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".SSA" ProgId="PotPlayerMini64.SSA" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".SUB" ProgId="PotPlayerMini64.SUB" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".tif" ProgId="ACDSee Ultimate 2019.tif" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".tiff" ProgId="ACDSee Ultimate 2019.tiff" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".TS" ProgId="PotPlayerMini64.TS" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".TTML" ProgId="PotPlayerMini64.TTML" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".VTT" ProgId="PotPlayerMini64.VTT" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".webp" ProgId="ACDSee Ultimate 2019.webp" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".wm" ProgId="PotPlayerMini64.WM" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".wmf" ProgId="ACDSee Ultimate 2019.wmf" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier=".wmv" ProgId="PotPlayerMini64.WMV" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".wmx" ProgId="PotPlayerMini64.WMX" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".wvx" ProgId="PotPlayerMini64.WVX" ApplicationName="PotPlayer 专用播放(64 位版)" />
  <Association Identifier=".xif" ProgId="ACDSee Ultimate 2019.xif" ApplicationName="ACDSee Ultimate 2019" />
  <Association Identifier="http" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier="https" ProgId="ChromeHTML" ApplicationName="Google Chrome" />
  <Association Identifier="mailto" ProgId="Outlook.URL.mailto.15" ApplicationName="Outlook 2016" />
</DefaultAssociations>

  1. dism /online /import-DefaultAppAssociations:assoc.xml
复制代码
你说的肯定不是是因为你没有用管理员权限执行。。。。

TOP

回复 2# kingshui


    你试了再说也不迟

TOP

本帖最后由 kingshui 于 2019-7-4 06:52 编辑

回复 3# 极度凶残


    嗯,我已经在工作环境中应用了大概400~500台了。


https://docs.microsoft.com/en-us ... ommand-line-options

TOP

回复  极度凶残


     嗯,我已经在工作环境中应用了大概400~500台了。
kingshui 发表于 2019-7-4 06:44



    那就奇怪了,试过把这条命令放在SetupComplete.cmd里在安装系统过程中运行,不行,试过右键以管理员身份运行CMD,再执行这条命令,有显示执行成功完成,但只是将C:\Windows\System32目录下的OEMDefaultAssociations.xml替换了, 根本没有影响到当前的用户

TOP

返回列表