dear All,
I'm new to this batch world, so any help much appreciated.
I have two files I need to compare those files and if there is differences may be in size, time modified then it will copy to other directory?
I want to implment this in batch script so, any help will be really appreciated ?
and if any other script can achive this one , are also appreciated, but I need how add that script so that I can accomodate it in batch script.
Help :: How to compare two files
Moderator: DosItHelp
Re: Help :: How to compare two files
no worries, that's a great start offcourse , thanks . I alreday tried that one, but anyway can you help me to refine my query further a bit
my comp gives a whole lots of lines
echo n | comp a.txt b.txt > out.txt
like comparing a.txt with b.txt
Files compare OK
n
now my question is how to find there is difference in files from out.txt
and if so then I need to move b.txt to some other loactaion?
my comp gives a whole lots of lines
echo n | comp a.txt b.txt > out.txt
like comparing a.txt with b.txt
Files compare OK
n
now my question is how to find there is difference in files from out.txt
and if so then I need to move b.txt to some other loactaion?
Re: Help :: How to compare two files
'
I did some tests, here are the results:
Compare.CMD
I've read on the forums, sometimes the binary switch seems required for a successful compare.
Hope it helps,
Ed
I did some tests, here are the results:
Compare.CMD
Code: Select all
@echo off
::
::fc /?
::
fc /l /n /w "compare.CMD" "compare.CMD" >out.TXT
fc /l /n /w "compare.CMD" "compare.CMD" &&echo.NOT different ||echo.different
fc /l /n /w "compare.CMD" "out.TXT" &&echo.NOT different ||echo.different
pause
exit
Code: Select all
Bezig met het vergelijken van bestanden compare.CMD en COMPARE.CMD
FC: geen verschillen gevonden
NOT different
Bezig met het vergelijken van bestanden compare.CMD en OUT.TXT
***** compare.CMD
1: @echo off
2: ::
3: ::fc /?
4: ::
5: fc /l /n /w "compare.CMD" "compare.CMD" >out.TXT
8: fc /l /n /w "compare.CMD" "compare.CMD" &&echo.NOT different ||echo.diff
erent
10: fc /l /n /w "compare.CMD" "out.TXT" &&echo.NOT different ||echo.differen
t
12: pause
13: exit
***** OUT.TXT
1: Bezig met het vergelijken van bestanden compare.CMD en COMPARE.CMD
2: FC: geen verschillen gevonden
*****
different
Druk op een toets om door te gaan. . .
Hope it helps,
Ed