通过批处理脚本(.bat)关闭pdf文件 [英] Closing a pdf file via a batch script (.bat)

查看:455
本文介绍了通过批处理脚本(.bat)关闭pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Windows批处理文件.bat运行乳胶命令来创建pdf.要打开最终的pdf文件,我写了

I use a windows batch file .bat for running latex command to create a pdf. To open the final pdf file, I wrote

pdflatex %2
START "" %2.pdf

%2是我作为参数传递的文件名.问题是,每当我运行脚本时,都必须手动关闭pdf文件并运行脚本.我想添加一条命令,首先关闭打开的pdf,然后运行latex命令,然后将其打开

Where %2 is the filename I passed it as argument. Problem is, whenever, I run the script, I have to manually close the pdf file and run the script. I want to add a command to first close the opened pdf and then run latex command and then open it

<CLOSE THE PDF FILE>
pdflatex %2
START "" %2.pdf

我没有在可用命令列表中找到CLOSE命令,批处理文件信息

I didn't find a CLOSE command in the list of available commands, Information on batch files

推荐答案

我强烈推荐 SS64 作为列表批处理命令.您要查找的命令是taskkill.我不知道pdflatex是否出现在任务管理器中,但是代码将类似于

I highly recommend SS64 for a list of batch commands. The command you're looking for is taskkill. I don't know pdflatex appears in the task manager, but the code is going to be something along the lines of

taskkill /IM acrord32.exe

将acrord32.exe替换为任务管理器中显示的内容.您可能还需要在/IM之前添加/F标志,以强制关闭程序.

Replace acrord32.exe with whatever it appears as in the task manager. You may also need to add the /F flag before the /IM to force close the program.

这篇关于通过批处理脚本(.bat)关闭pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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