方法1:cmd下输入
assoc .bat=batfile
ftype batfile="%1" %* 或 ftype batfile=cmd.exe /c "%1" %*
方法二:修改注册表
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfile]
@="MS-DOS批处理文件"
"EditFlags"=hex:30,04,00,00
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileDefaultIcon]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,53,79,73,74,65,6d,33,32,5c,73,
68,65,6c,6c,33,32,2e,64,6c,6c,2c,2d,31,35,33,00
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshell]
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshelledit]
@="编辑(&E)"
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshelleditcommand]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,53,79,73,74,65,6d,33,32,5c,4e,
4f,54,45,50,41,44,2e,45,58,45,20,25,31,00
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshellopen]
"EditFlags"=hex:00,00,00,00
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshellopencommand]
@=""%1"%*"
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshellprint]
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshellprintcommand]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,53,79,73,74,65,6d,33,32,5c,4e,
4f,54,45,50,41,44,2e,45,58,45,20,2f,70,20,25,31,00
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshellex]
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshellexDropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshellexPropertySheetHandlers]
[HKEY_LOCAL_MACHINESOFTWAREClassesbatfileshellexPropertySheetHandlersPifProps]
@="{86F19A00-42A0-1069-A2E9-08002B30309D}"