songren3 当前离线
列兵
a20150604 当前离线
禁止发言
@echo off REM 参考: REM https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/prnmngr REM https://www.windows-commandline.com/add-delete-set-default-printer-windows/ REM 找出 prnmngr.vbs 路径 可能有多个 dir /s /b "%windir%\system32\prnmngr.vbs" for /f "delims=" %%a in ('dir /s /b "%windir%\system32\prnmngr.vbs"') do ( set "prnmngr_vbs_path=%%a" ) set prnmngr_vbs_path REM 打印机列表 cscript "%prnmngr_vbs_path%" -l REM 设置默认打印机语法 REM cscript "%prnmngr_vbs_path%" -t -p "\\Servername\printername" REM 设置默认打印机实例 cscript "%prnmngr_vbs_path%" -t -p "\\asus\Brother DCP-7080 Printer" cscript "%prnmngr_vbs_path%" -t -p "Microsoft XPS Document Writer" REM 显示默认打印机 cscript "%prnmngr_vbs_path%" -g REM 打印机管理控制面板 control printers pause复制代码
TOP
flashercs 当前在线
少校
wmic path win32_printer get deviceid复制代码
wmic path win32_printer.deviceid="打印机名" call setdefaultprinter复制代码
qixiaobin0715 当前在线
大校
@echo off REM 打印当前目录下的docx,doc cd /d "%~dp0" REM 设置程序Microsoft Word或WPS路径 set WordApp="C:\Program Files\Microsoft Office\Root\Office16\WINWORD.EXE" for %%A in (*.doc) do WordApp /i "%%~fA" pause exit /b复制代码
cloversky 当前离线