批量打印PDF文件,在一个文本文件中列出 [英] Batch print PDF files listed in a text file

查看:821
本文介绍了批量打印PDF文件,在一个文本文件中列出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是新来CMD,但我想编写一个批处理打印解决方案。

Hello I am new to CMD but I would like to make a batch printing solution.

我知道,使用:

"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t "C:\file_1.pdf"

我可以打印file_1.pdf但我真正需要的是打印多个文件,比方说file_2,file_3 ... file_n,所以我的指令将变为:

I can print file_1.pdf but what I really need is to print multiple files, let's say file_2, file_3... file_n, therefore my instruction will change to:

"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t "C:\XXXX.pdf"

我想过做一个文本文件,在那里我可以写,我需要打印的文件的名称。然后在批处理文件做一个循环,将阅读文本的每一行,并改变我的变量XXXX为TEXT的每一行中指定的文件名。

I thought about making a TEXT file where I could write the name of the files that I need to print. Then in a batch file make a loop that will read each line of the TEXT and change my variable XXXX for the name of the file specified in each row of the TEXT.

这可能吗?我不傻,我学习快,所以,如果任何机构能怎么办变量在批处理文件中,以及如何阅读信息,表格中的文字,将是非常美妙的指向正确的方向我。

Is this possible? I'm not stupid and I learn fast so, if any body can point me in the right direction of how to do variables in batch files, and how to read information form a TEXT it would be fantastic.

推荐答案

运行为/?中的cmd.exe窗口和读取输出,或者看到的 循环命令:对一组文件

Run for /? in a cmd.exe Window and read the output, or see Loop command: against a set of files.

基本上,如果你想批量打印所有PDF目录中,可以做到以下几点:

Basically, if you want to batch print all PDFs in a directory, you can do the following:

for %i in (*.pdf) do ^
  "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t %i

这是直接在DOS窗口窗口中​​运行,如果要使用的线路。如果从BAT文件中运行,则需要更换%I %%我

This is the line to be used if run directly in a 'DOS box' window. If run from a BAT file, you need to replace %i by %%i.

如果您有文件将要打印一行列举行的* .txt文件:

If you have the files-to-be-printed enumerated line by line in a *.txt file:

for /f %i in (mypdfs.txt) do ^
  "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t %i

<子>(注意:我没有测试运行的命令,因为我没有围绕Windows系统,但我凭着我的记忆老化这里...

(Note: I didn't test-run the commands, since I don't have a Windows system around, but I'm relying on my aging memory here...

这篇关于批量打印PDF文件,在一个文本文件中列出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆