check the contetns of two folders
Posted: 27 Aug 2010 03:57
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
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