jaclaz, on 12 July 2012 - 03:00 AM, said:
@ECHO OFF
CD /D %~dp0
SET Program="C:\My program directory\eps to pdf\epstopdf.exe"
for %%A in (*.eps) do %Program% %%A
this assumes that you copy the small batch to the directory and that you have the program in a "fixed" directory, in the example "C:\My program directory\eps to pdf\epstopdf.exe".
The %~
dp0 will expand to the
drive and
path of the item
0 of the command line (the batch file itself).
Since there always is room for improvement, let me please suggest one:
@ECHO OFF
PUSHD %~dp0
SET Program="C:\My program directory\eps to pdf\epstopdf.exe"
for %%A in (*.eps) do %Program% %%A
POPD
The pair PUSHD/POPD saves the current drive:\directory, before changing to the new one, then returns to it, respectively.
So, at the end, you'll be back to the folder you started in.