I want to create a bat file that searches a specific folder for *.pdf files and executes the following two commands:
C:\Program Files (x86)\Nitro PDF\Professional\NitroPDF.exe /CV "pdf-filename"
move the file from C:\Users\ADMINI~1.MED\AppData\Local\Temp\1\pdf-filename
to z:\
Any ideas?
I have written the following which returns the .pdf
files:
FORFILES /P z:\ /M *.rtf /C "cmd /c echo @file"
I think this will work both from the command line and from within a batch file
FORFILES /P z:\ /M *.rtf /C "cmd /c \"C:\Program Files (x86)\Nitro PDF\Professional\NitroPDF.exe\" /CV @PATH & MOVE C:\Users\ADMINI~1.MED\AppData\Local\Temp\1\@FILE Z:\"
i think the easiest thing is to push the files resolved by "forfiles" to a second batch file... I tested it and show you my example (you only have to change "secondbat.bat to nitropdf and the second thing...).
C:\Users\keeny\test>dir
Verzeichnis von C:\Users\keeny\test
03.01.2012 10:27 <DIR> .
03.01.2012 10:27 <DIR> ..
03.01.2012 10:28 10 secondbat.bat
03.01.2012 10:25 0 test.txt
03.01.2012 10:25 0 test2.txt
3 Datei(en), 10 Bytes
2 Verzeichnis(se), 67.541.872.640 Bytes frei
C:\Users\keeny\test>
then i typed
forfiles /P . /M *.txt /C "cmd /c secondbat.bat @file"
the secondbat gets its parameter by %1.
Content of secondbat.bat is only:
notepad %1
this test started 2 notepads...
I think this is it (please tell me if it worked the way you wanted to).