Comments (3)

  1. Dmitry Streblechenko says:

    It looks like the zip file is empty 🙁

  2. SG says:

    What is the best trigger for this code?

    On system startup

  3. Andrei Ghita says:

    I'd say write a batch file or vbscript to run the exe and configure a Group Policy Object to run the script at logon.

    Here's a script example:

    Dim checkpoint, EXEPath

    EXEPath = WScript.Arguments.Item(0)

    Const HKEY_CLASSES_ROOT    = &H80000000

    Const HKEY_CURRENT_USER    = &H80000001

    Const HKEY_LOCAL_MACHINE   = &H80000002

    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\.rootdefault:StdRegProv")

    strKeyPath = "Outlook.ApplicationCurVer"

    strValueName = ""

    Dim oShell

    Set oShell = CreateObject("WScript.Shell")

    oReg.GetStringValue HKEY_CLASSES_ROOT, strKeyPath, strValueName, strValue

    ' Wscript.Echo strValue

    if (strvalue = "Outlook.Application.15") Then

    Wscript.Echo "Office 15"

    oReg.GetStringValue HKEY_LOCAL_MACHINE, "SoftwareMicrosoftOffice15.0Outlook", "Bitness", Bitness

    If (Bitness = "x86") Then

    Wscript.Echo "It's 32 Bit"

    oReg.GetDWORDValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles", "checkpoint", checkpoint

    If ((IsNull(checkpoint)) or (checkpoint = 0)) Then

          oShell.Run Chr(34) &  EXEPath  & "EXEName_x86.exe" & Chr(34)

        WScript.Sleep 5000

        oReg.SetDWORDValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles", "checkpoint", 1

    End If

    Else

    Wscript.Echo "It's 64 Bit"

    oReg.GetDWORDValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles", "checkpoint", checkpoint

    If ((IsNull(checkpoint)) or (checkpoint = 0)) Then

        oShell.Run Chr(34) &  EXEPath  & "EXEName_x64.exe" & Chr(34)

        WScript.Sleep 5000

        oReg.SetDWORDValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles", "checkpoint", 1

    End If

    End If

    End If

    if (strvalue = "Outlook.Application.14") Then

    Wscript.Echo "Office 14"

    oReg.GetStringValue HKEY_LOCAL_MACHINE, "SoftwareMicrosoftOffice14.0Outlook", "Bitness", Bitness

    If (Bitness = "x86") Then

    Wscript.Echo "It's 32 Bit"

    oReg.GetDWORDValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles", "checkpoint", checkpoint

    If ((IsNull(checkpoint)) or (checkpoint = 0)) Then

        oShell.Run Chr(34) &  EXEPath  & "EXEName_x86.exe" & Chr(34)

        WScript.Sleep 5000

        oReg.SetDWORDValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles", "checkpoint", 1

    End If

    Else

    Wscript.Echo "It's 64 Bit"

    oReg.GetDWORDValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles", "checkpoint", checkpoint

    If ((IsNull(checkpoint)) or (checkpoint = 0)) Then

            oShell.Run Chr(34) &  EXEPath  & "EXEName_x64.exe" & Chr(34)

        WScript.Sleep 5000

        oReg.SetDWORDValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles", "checkpoint", 1

    End If

    End If

    End If

Skip to main content