Board logo

标题: [系统相关] 【已解决】批量打印文件 [打印本页]

作者: 牛虻    时间: 2019-11-6 10:26     标题: 【已解决】批量打印文件

本帖最后由 牛虻 于 2019-11-21 10:26 编辑

win10系统使用默认打印机打印指定文件夹下或当前文件夹下的所有文本文件(.xls .txt .bat .doc)
作者: xczxczxcz    时间: 2019-11-6 17:31

  1. ls '.\*.xls','.\*.txt','.\*.bat','.\*.doc'|out-printer
复制代码

作者: 牛虻    时间: 2019-11-13 10:01

回复 2# xczxczxcz


这是我按照命令打印出来的,不对
作者: 牛虻    时间: 2019-11-13 10:51

回复 3# 牛虻


   使用 get-content 只能打印txt文件
作者: flashercs    时间: 2019-11-13 19:18

l plain text - Notepad /p "%1"   (has /PT switch )
        l rich format text (.rft , .odt), plain  text , word documents (.doc .docx) (if no MS OFFICE installed)  - "%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE" /p "%1" (has /pt swith)
        l html,htm,svg - "%systemroot%\system32\rundll32.exe" "%systemroot%\system32\mshtml.dll",PrintHTML "%1" (no explicit /pt switch but the other arguments can be passed)
        l images , wdp - "%SystemRoot%\System32\rundll32.exe" "%SystemRoot%\System32\shimgvw.dll",ImageView_PrintTo /pt "%1"  (no explicit /pt switch but the other arguments can be passed)
        l font files (ttf , ttc , pfb , pfm, oft )- %SystemRoot%\System32\fontview.exe /p %1
        l fax cover documents (.cov) - %systemroot%\system32\fxscover.exe /P "%1"
        l wdp file (Windows Media Photo )  , hdp (HD Photo) , font files  (ttf , ttc , pfb , pfm, oft )  - rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen %1
        l emf (microsoft vector format) , images "%systemroot%\system32\mspaint.exe" /p "%1" (has /pt switch)
作者: ivor    时间: 2019-11-13 20:34

  1. powershell "Get-ChildItem '*.xls','*.txt','*.bat','*.doc' | ForEach-Object {Start-Process -FilePath $_.FullName -Verb Print}"
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2