欢迎来到 嗅灵易学

零基础也能上手的脚本技术课,一对一答疑带你入门

另外一种检测SOFTICE的方法,保证用的人很少 ^_^ (1千字)

另外一种检测SOFTICE的方法,保证用的人很少 ^_^ (1千字)

Public Sub DetectICE(xVersion As String)
On Error Resume Next
Dim x As Long
Randomize
xF = CLng(Rnd * 29999)
x = Shell("cmd.exe /c net stop " & xVersion & " > \nul 2>c:\tmp" & Trim(CStr(xF)) & ".txt", vbHide)
xTime = Timer
Do
DoEvents
If Dir$("c:\tmp" & Trim(CStr(xF)) & ".txt") <> "" Or Timer > (xTime + 3) Then
  If Timer > (xTime + 3) Then
    Exit Do
  ElseIf FileLen("c:\tmp" & Trim(CStr(xF)) & ".txt") > 30 Then
    Exit Do
  End If
End If
Loop
If FileLen("c:\tmp" & Trim(CStr(xF)) & ".txt") > 30 Then
  Dim xFile As String
  xFile = String(FileLen("c:\tmp" & Trim(CStr(xF)) & ".txt"), 0)
  Open "c:\tmp" & Trim(CStr(xF)) & ".txt" For Binary As #1
    Get #1, 1, xFile
  Close #1
  If LCase(xVersion) = "ntice" Then
      xSoft = "SoftICE-NT"
  Else
      xSoft = "SoftICE-9x"
  End If
  If InStr(1, xFile, "specified service does not exist") > 0 Then
      MsgBox xSoft & " does not exist on this machine."
  ElseIf InStr(1, xFile, "requested pause or stop is not valid") > 0 Then
      MsgBox xSoft & " is installed AND RUNNING"
  ElseIf InStr(1, xFile, "service is not started") > 0 Then
      MsgBox xSoft & " is installed but not running at the moment."
  Else
      MsgBox "Error - unable to determine. Results:" & vbCrLf & xFile
  End If
Else
  MsgBox "Error - couldn't determine."
End If
Kill "c:\tmp" & Trim(CStr(xF)) & ".txt"
End Sub
用法:
On Error Resume Next ' 呵呵,我怕她出错。。。
Call DetectICE("ntice")
Call DetectICE("sice")

注意:上传附件及图片大小不得大于30M。

⚠️ 版权声明:
本博客所有内容(含教程、源码、工具)仅供个人技术学习与研究交流使用,严禁商用、倒卖、二次分发及非法用途
未经作者书面授权,任何组织或个人不得转载、复制或用于其他平台,违者将追究相关责任。

0 0 0 举报
复制成功