vbs指令碼獲取Am註冊路徑資訊

mobox發表於2020-05-20

Dim WshShell, AMpath, Dllfile


Set WshShell = WScript.CreateObject("WScript.Shell")


call X86orX64()


 MsgBox X86orX64


If X86orX64 = "x86"  then

    dllfile = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ActiveSoft\STKClient")

    MsgBox Dllfile

Else

    dllfile = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ActiveSoft\STKClient")

    MsgBox Dllfile

End If


Function X86orX64()

    On Error Resume Next

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)

    

    For Each objItem in colItems

        If InStr(objItem.SystemType, "86") <> 0 Then

            X86orX64 = "x86"

        ElseIf InStr(objItem.SystemType, "64") <> 0 Then

            X86orX64 = "x64"

        Else

            X86orX64 = objItem.SystemType

        End If

    Next

    

End Function


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28660496/viewspace-2693188/,如需轉載,請註明出處,否則將追究法律責任。

相關文章