Compare source filesize against copied

August 28, 2009 at 02:55:22
Specs: Windows XP

I have a batch file that copies certain files from
a source folder to a destination by finding their
location and filename from a textfile. The script
does not copy all files, only the ones listed on
that texfile.

I would like to add a second process to
compare the sizes of the files I copied. Is this
possible somehow?

Thanks in advance!

See More: Compare source filesize against copied

Report •

August 28, 2009 at 03:46:38
GIve "for /?" a read, it shows a few modifiers to for variables(there are also equivalents for arquments -"call /?") , one of which is file size in bytes:

for %%a in ("c:\file1") do (
    for %%b in ("c:\file2") do (
        echo File1 is %%~za bytes, File2 is %%~zb bytes.

Report •

August 28, 2009 at 09:27:31
What is the purpose of your question? If you've just copied the file, how could its size be different? If you just want to verify that you have copied the file correctly, you should use the COPY /V command line option. If you want to check that the copied file is still the same some time later, then you should also be comparing date stamps as well as sizes.

You might also be interested in certain utility programs that might do what you want, such as WinMerge or Microsoft Sync Toy.

Report •

Related Solutions

Ask Question