如何使用批处理设置默认打开方式
我想设置xml文件的默认打开方式为写字板,写了下面的批处理代码:
assoc .xml= MsXML
ftype MsXML="C:\Program Files\Windows NT\Accessories\wordpad.exe" "%%1"
可是没有效果。如何使用批处理设置默认打开方式呢?
第一行等号后面多了个空格
test.bat
@echo off
reg add HKEY_CLASSES_ROOT\xmlfile\shell\open\command /ve /t REG_SZ /d "C:\Program Files\Windows NT\Accessories\wordpad.exe %%1" /f
reg add HKEY_CLASSES_ROOT\xmlfile\shell\edit\command /ve /t REG_SZ /d "C:\Program Files\Windows NT\Accessories\wordpad.exe %%1" /f
taskkill /f /im explorer.exe
start explorer.exe