It can't be checked just by comparing these variables:
C:\>set "d1=C:\"
C:\>set "d2=C:\Windows\.."
C:\>if %d1%==%d2% (echo true) else (echo false)
false
I can make up a sophisticated construct with pushd
and popd
and additional variables but isn't there a simpler way?
dont know if it will suite to your need but you could create a file on 1st dir anc check if it exists in second :
Similar to jeb's solution, but using FOR instead of called subroutine
You could normalize the variables with a small function.