I'm writing a DOS batch job to review two different directories, identify files with like first six characters, and then move both the matched files to a third directory. I'm getting a syntax error on the following code. Any suggestions?
File 1:
set CopyCount=0
for %%f in (??????*.tif) do call ..\MatchMove1.bat %%f
cd ..
if %CopyCount%==0 goto end
ECHO %date%-%time% %CopyCount% "Matched and Copied" >> MatchMove.log
ECHO %date%-%time% "**************************************************" >> MatchMove.log
echo %CopyCount%
:end
File 2(MatchMove1)
set xFile=%1
set pFile=%xFile:~0,6%
cd..
if not exist "Copy3_Certificates_tiff\%Pfile%*.tif" PAUSE goto end
copy "Copy4_Working_Documents\%pfile%*.tif" "Copy5_Cert_WorkDoc_Match"
copy "Copy3_Certificates_tiff\%pfile%*.tif" "Copy5_Cert_WorkDoc_Match"
rename "Copy4_Working_Documents\%xFile%" "%xFile%*.cpy"
rename "Copy3_Certificates_tiff\%pfile%*.tif" "%pfile%*.tif.cpy"
ECHO %date%-%time% "Files starting with "%pfile%" copied" >> ..\MatchMove.log
set /a CopyCount =%CopyCount%+1
:end