Forum Discussion
HKosova
Alumni
12 years agoHi Richard,
I recommend that you use the Word file comparison extension instead.
But if you prefer fc, you can get its exit code and output like this (note single backslashes in paths):
I recommend that you use the Word file comparison extension instead.
But if you prefer fc, you can get its exit code and output like this (note single backslashes in paths):
Sub Test
Dim oShell, oExec
Set oShell = Sys.OleObject("WScript.Shell")
Set oExec = oShell.Exec("fc ""C:\Users\%USERNAME%\Documents\" & strFile & _
".docx"" ""C:\Users\%USERNAME%\Documents\" & strFile & "2.docx""")
Do While oExec.Status = 0
Delay 100
Loop
If oExec.ExitCode = 0 Then
Call Log.Checkpoint("The files are the same.")
Else
Call Log.Error("The files are different. See Additional Information.", oExec.StdOut.ReadAll)
End If
End Sub