找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 28456|回复: 5

[系统相关] 【已解决】批量打印文件

[复制链接]
发表于 2019-11-6 10:26:10 | 显示全部楼层 |阅读模式
本帖最后由 牛虻 于 2019-11-21 10:26 编辑

win10系统使用默认打印机打印指定文件夹下或当前文件夹下的所有文本文件(.xls .txt .bat .doc)
发表于 2019-11-6 17:31:34 | 显示全部楼层
  1. ls '.\*.xls','.\*.txt','.\*.bat','.\*.doc'|out-printer
复制代码
 楼主| 发表于 2019-11-13 10:01:19 | 显示全部楼层
回复 2# xczxczxcz


这是我按照命令打印出来的,不对
 楼主| 发表于 2019-11-13 10:51:05 | 显示全部楼层
回复 3# 牛虻


   使用 get-content 只能打印txt文件
发表于 2019-11-13 19:18:06 | 显示全部楼层
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)
发表于 2019-11-13 20:34:29 | 显示全部楼层
  1. powershell "Get-ChildItem '*.xls','*.txt','*.bat','*.doc' | ForEach-Object {Start-Process -FilePath $_.FullName -Verb Print}"
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-19 11:36 , Processed in 0.018265 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表