@echo off
REM Writing the folder tree to a file for each path
pushd "Folder 1"
for /f "delims=" %%c in ('tree /f') do >>"%~dp0folder1.txt" echo "%%c"
popd
pushd "Folder 2"
for /f "delims=" %%d in ('tree /f') do >>"%~dp0folder2.txt" echo "%%d"
popd
REM removing the first three lines from each of the two files
more +3 "folder1.txt" >"folder1.txt.new"
move /y "folder1.txt.new" "folder1.txt" >nul
more +3 "folder2.txt" >"folder2.txt.new"
move /y "folder2.txt.new" "folder2.txt" >nul
REM comparing files
fc /b folder1.txt folder2.txt>nul && echo same || echo different
REM cleaning up
del folder1.txt
del folder2.txt
Should work as long as the folders are on the same drive. Changes the directory to the first folder and prints the output of the command tree to one file and same for the other folder.
Then compares a /b
inary file comparison and outputs same
if the outputs of the command and with that the folders are the same. If not it outputs different
.
Deletes two help-files after.
NOTE: If you already have files with that names, change it!
Feel free to ask if something is unclear :)
Edit: Remove first 3 lines to prevent comparison faliures based on Volume-Number/Drive-Letter. Credit for the way to remove goes to dbenhams answer to another question.