11-18-2022, 09:27 PM
Code: (Select All)
Option Explicit
$NoPrefix
$Console:Only
Dim As String file1, file2, hash1, hash2
file1 = "C:\Users\zspriggs\Documents\QB64\qb64pe.exe"
'file2 = "C:\Users\zspriggs\Documents\QB64\pipecomqb64.bas"
file2 = file1 'You can comment this line and uncomment the one above. Obviously, you'll replace the paths with ones you have.
hash1 = GetHash(file1)
hash2 = GetHash(file2)
If hash1 = hash2 Then Print "Same" Else Print "Different"
Function GetHash$ (filename As String)
Dim As String filecopy: filecopy = "\" + Chr$(34) + filename + "\" + Chr$(34)
GetHash = pipecom_lite("PowerShell -NoProfile Get-FileHash -Path " + filecopy + " ^| foreach {$_.Hash}")
End Function
'$Include:'pipecomqb64.bas'
Ask me about Windows API and maybe some Linux stuff