Batch file: compare files? -
i have batch file checking files in map.
my situation:
i have example map on directory a. on directory b have map a. on directory b people working in files, there change files can delete or missing. want compare 2 maps missing files, maybe delete or missing.
so comparing must this:
directory map :compare-> directory b map a
result must be: no changes or missing files!
can me?
thanks!!
assuming have correctly shared remote directory on network, , have configured relevant netbios, tcp/ip settings, , on same subnet mask etc. should work:
@echo off net use x: "\\computer-name\path-to-shared-subdirectory" del /q "missing.txt" 2>nul /f "tokens=*" %%i in ('dir /b /a:-d-h x:') ( if not exist "%userprofile%\directory-path\%%i" echo %%i )>>missing.txt pause
i may have wrong way around, otherwise be:
@echo off net use x: "\\computer-name\path-to-shared-subdirectory" del /q "missing.txt" 2>nul /f "tokens=*" %%i in ('dir /b /a:-d-h "%userprofile%\subdirectory-path\"') ( if not exist "x:\%%i" echo %%i )>>missing.txt pause
either way command you'd interested in, among others, net use