#include <windows.h>
#include <iostream.h>
#include <stdio.h>
void
main()
{
char
file1[50] =
"C:\\Users\\ago\\Desktop\\C++.bat"
;
char
file2[50] =
"C:\\Users\\ago\\Desktop\\C++ - 副本.bat"
;
char
command[100] = {0};
sprintf
( command,
"FC /B \"%s\" \"%s\" |find \"FC: 找不到差异\" >temp.txt"
, file1 , file2);
system
(command);
memset
(command,0,100);
FILE
*file =
fopen
(
"temp.txt"
,
"r"
);
fread
(command,1,100,file);
fclose
(file);
if
(command[0]==
'\0'
)
{
cout<<
"有差异"
<<endl;
}
cout<< command <<endl;
system
(
"del temp.txt"
);
}