https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15710

--- Comment #2 from Peter Wu <pe...@lekensteyn.nl> ---
Good point about PATHEXT, let's assume if an extension is present, the
interpreter should be correctly installed.

Here I found "ftype" and "assoc" commands which can be helpful:
https://stackoverflow.com/questions/1934675/how-to-execute-python-scripts-in-windows

Documentation in MSDN is a bit sad, the ASSOCF type points to the wrong page.
The shlwapi.h header does have the definitions though. AssocQueryString docs:
https://docs.microsoft.com/en-us/windows/desktop/api/shlwapi/nf-shlwapi-assocquerystringw

There are two potentially useful types, ASSOCSTR_COMMAND and
ASSOCSTR_EXECUTABLE. For ".py", these expand to respectively:

    "C:\Windows\py.exe" "%L" %*
    C:\Windows.py.exe

When used with unknown extensions and ASSOCF_NONE, it would expand to
respectively:

    C:\Windows\system32\rundll32.exe
C:\Windows\System32\shell32.dll,OpenAs_RunDLL %1
    C:\Windows\system32\shell32.dll

Use of ASSOCF_INIT_IGNOREUNKNOWN will make the function fail instead.

When used with .com, .exe, .bat, or .cmd, it will be:

    "%1" $*
    %1

>From what I have read, the Command string is interpreted by Internet Explorer,
but I have not found canonical documentation from MS. The executable value
seems good enough, it would work for .js, .pl, .py, .pyw, etc.

-- 
You are receiving this mail because:
You are watching all bug changes.
___________________________________________________________________________
Sent via:    Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives:    https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
             mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

Reply via email to