|
你可以通过注册表查询文件关联中的Print\Command,就是右键菜单的打印,比如doc可能是这样的,将"%1"替换成你的文件路径即可。
- "C:\Program Files\Microsoft Office\Root\Office16\WINWORD.EXE" /i "%1"
复制代码
下面是NSIS写的,打印列表.txt每行一个文件完整路径:
- !include "MUI2.nsh"
- !define PRODUCT_NAME "批量打印"
- !define PRODUCT_VERSION "1.0.0.0"
- Name "${PRODUCT_NAME}"
- Caption "${PRODUCT_NAME}"
- OutFile "${PRODUCT_NAME}.exe"
- BrandingText " "
- ManifestDPIAware true
- XPStyle on
- ShowInstDetails show
- SetFont "Microsoft YaHei" 9
- RequestExecutionLevel user
- ; 程序图标 print.ico
- ; !define MUI_ICON "print.ico"
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_LANGUAGE "SimpChinese"
- Section
- SectionEnd
- Function .Oninit
- IfFileExists "$EXEDIR\打印列表.txt" 0 exit
- MessageBox MB_YESNO "是否批量打印 打印列表.txt 中的所有文件?" IDNO exit
- ClearErrors
- FileOpen $0 "$EXEDIR\打印列表.txt" r
- IfErrors exit 0
- start:
- IfErrors end 0
- FileRead $0 $R0
- IfFileExists '$R0' 0 +2
- ExecShell print '$R0'
- FileSeek $0 1 CUR
- goto start
- end:
- FileClose $0
- exit:
- MessageBox MB_OK|MB_ICONSTOP "打印列表.txt不存在!"
- Quit
- FunctionEnd
复制代码
|
-
-
批量打印.7z
28.36 KB, 下载次数: 5, 下载积分: 无忧币 -2
|