example 1
@echo off
for %%a in (precomp.exe) do set pc=%%~fa
for /r %%a in (*.pcf) do (
pushd %%~dpa
echo [%pc% -r %%~nxa]
%pc% -r %%~nxa
popd
)
When i run the bat i get precomp.exe is an unknown command I have precomp in the folder with the script. But it will only work if i copy precompt to every sub directory and every folder that contains a .pcf file
Tried a different approach using 2 scripts
script1
for /r %%i in (*.pcf) do call sr2 "%%~pi" "%%i"
script 2
pushd %1
precomp -r %2
popd
Both scripts work but only if i copy precomp into Ever folder and all sub folders. Please help as i know there must be away to make the script use the precomp in the folder with the script