作者:高高G0623 | 来源:互联网 | 2023-09-15 20:17
篇首语:本文由编程笔记#小编为大家整理,主要介绍了Vbscript IEM-下载检测相关的知识,希望对你有一定的参考价值。
'-------------------------------------------------
'Download the program file from ldlogon
Function FileDownload(filename)
Log "The name of the file to download is: " & filename
FileDownload = False
Dim strHash
Dim strPath
Dim strLocalhash
Dim strHttpsource
Dim intStatus
strHash = GetFileHashCore(filename)
Log "Core Hash = " & strHash
strPath = GetWorkPath() & filename
Log "Working Path = " & strPath
strLocalhash = GetFileHashLocal(strPath)
Log "Local Hash = " & strLocalhash
strHttpsource = "http://" & GetCoreName() & "/ldlogon/" & filename
If strLocalhash = strHash Then
Log "The file is already in the LDClient directory."
FileDownload = True
Else
intStatus = Downloadfile(strHttpsource, strPath, strHash)
strHash = GetFileHashCore(filename)
strLocalhash = GetFileHashLocal(strPath)
If strLocalhash = strHash Then
Log "The file downloaded sucessfully."
FileDownload = True
End If
End If
End Function