[issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)

2021-02-25 Thread Eryk Sun
Change by Eryk Sun : -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)

2017-07-21 Thread Eryk Sun
Eryk Sun added the comment: That depends on the shortcut. I have some shortcuts that are designed to be run from the command line (e.g. python.lnk), which take arguments and inherit the working directory of the parent process. I add .LNK to PATHEXT so I can run them as commands without a

[issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)

2017-07-21 Thread Tim Golden
Tim Golden added the comment: For shell objects such as shortcuts you could use os.startfile which invokes ShellExecute under the covers -- ___ Python tracker

[issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)

2017-07-20 Thread Eryk Sun
Eryk Sun added the comment: subprocess.Popen calls WinAPI CreateProcess, which can execute PE/COFF executables and .BAT/.CMD batch scripts. It doesn't know anything about .LNK shell shortcuts. If CreateProcess fails, a Windows shell (e.g. CMD or PowerShell) tries ShellExecuteEx, which knows

[issue30979] the winapi fails to run shortcuts (because considers a shortcut not a valid Win32App)

2017-07-20 Thread Bernát Gábor
New submission from Bernát Gábor: Although python27.exe.lnk is callable from any command line tool, with any of its arguments the subprocess module thinks it's not a valid Win32 application. Proof, let there be python27.exe.lnk be a shortcut to python.exe: C:\Python27 λ ls python* python.exe*