Page 1 of 1

check the contetns of two folders

Posted: 27 Aug 2010 03:57
by express
Hi folks

i am looking to check the contents of two (hopefully) identical folders on two different servers to check that they are identically replicated. i have tried the following

@echo off
set "data=P:\
set "arch=E:\filepath
set "log=E:\logfile.txt"

rem echo N| comp "%data%" "%arch%" 2>nul 1>nul &&echo Equal> "%log%" ||(
fc "%data%" "%arch%" >nul &&echo Equal> "%log%" ||(
echo Not equal> "%log%"
for %%a in ("%data%" "%arch%") do if "%%~za"=="0" echo Zero sized %%a>> "%log%"
)

but this just returns as them not being equal. P:\ is the mapped drive is there an easy way to use the full share path as i just get an empty log file when using \\server\filepath and \\server2\filepath do i need to put in a switch or anything?

thanks in advance

H

Re: check the contetns of two folders

Posted: 27 Aug 2010 05:09
by ghostmachine4
you can download diffutils for windows, then do this

Code: Select all

c:\> diff c:\myfolder1 c:\myfolder2

Re: check the contetns of two folders

Posted: 27 Aug 2010 05:19
by express
the problem is they reside on different servers.
one folder is mapped to the other server so should be able to use P:\ and then E:\folder path

but it just returns an empty log.

is there string for all files contained within? i could try that after P:\?