将PDF文件跟踪器创建为批处理文件

时间:2023-01-19 18:41:57

I have created a batch file which is supposed to keep track of the opened PDF files on my system.As soon as someone opens the PDF file,the name of the file as well as time of access is recorded in a log file. Here is code of my batch file:

我创建了一个批处理文件,用于跟踪我系统上打开的PDF文件。只要有人打开PDF文件,文件名和访问时间就会记录在日志文件中。这是我的批处理文件的代码:

@echo off
echo FILE ACCESSED %1 >> I:\Batch\log.txt
echo TIME OF ACCESS %TIME% >> I:\Batch\log.txt
"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe" %1
EXIT

I have also set up this batch file as the default application fr the PDF files to open with. Now,the problem is,as soon as I open any PDF file,many cmd windows start opening and closing unendingly. Please suggest some remedy.

我还将此批处理文件设置为要打开的PDF文件的默认应用程序。现在,问题是,只要我打开任何PDF文件,许多cmd窗口就会无休止地开始和关闭。请提出一些补救措施。

Thanks....

1 个解决方案

#1


0  

@echo off
copy %1 %1.tmp
echo FILE ACCESSED %1 >> I:\Batch\log.txt
echo TIME OF ACCESS %TIME% >> I:\Batch\log.txt
"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe" %1.tmp
del %1.tmp
EXIT

#1


0  

@echo off
copy %1 %1.tmp
echo FILE ACCESSED %1 >> I:\Batch\log.txt
echo TIME OF ACCESS %TIME% >> I:\Batch\log.txt
"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe" %1.tmp
del %1.tmp
EXIT