windows - Checking if two files in batch are the same size -
if have path 2 files in different windows directories, how can compare same size?
%appdata%/profiles.ini %username%/desktop/profiles.ini
i want compare same file, first thing comes mind check
- the files have same name
- the files same size
if can suggest better ways or improvements please say.
as know file names , why need check if names same?
not tested.
this test if files have same size
@echo off set "file1=%appdata%/profiles.ini" set "file2=%appdata%/profiles.ini" /f "tokens=1,2 delims=?" %%a in ("%file1%?%file2%") ( if %%~za equ %%~zb ( echo equal ) else ( echo not equal ) )
edit.
may fc
command need (compares content of 2 files).
@echo off set "file1=%appdata%/profiles.ini" set "file2=%appdata%/profiles.ini" fc "%file1%" "%file2%" && ( echo files same color )||( echo files different )
Comments
Post a Comment