Compare two folders and get new and modified file names

April 25, 2012 at 01:20:27
Specs: Windows XP
Hi,

I want a shell script which compare two folders (with some similar files) and get new files and the files which are modified.
It will be good if the new and the modified files moved to third folder.

I have the following script, which identifies the new script and find the comarision of the files and store in log files. I am unable to get the modified file names.
Please look and help

----------------------------------------------------------------------------------------------------
if exist compare.log del compare.log
if exist missing.log del missing.log
for /f "delims=" %%a in ('dir /b/a-d "C:\TFSworkspace\Scripts"') do (
if exist "C:\tfs\Scripts\%%a" (
fc "C:\TFSworkspace\Scripts\%%a" "C:\tfs\Scripts\%%a" >> compare.log
) else (
echo %%a >> missing.log
)
)
-------------------------------------------------------------------------------------------------------------


See More: Compare two folders and get new and modified file names

Report •


#1
April 25, 2012 at 07:49:10
Don't know if this would be the most efficient but have you tried using the "comp" command on existing files?

hth

Elinor Hurst
http://elinorhurst.blogspot.com


Report •
Related Solutions


Ask Question