I want to launch a shortcut named blender.ink
located at "D://games//blender.ink"
. I have tryed using:-
os.startfile ("D://games//blender.ink")
But it failed, it only launches exe files.
The Python os.startfile
function should work fine, but you need to specify a .lnk
extension to be a valid Windows shortcut file:
import os
os.startfile (r"D:\games\blender.lnk")
If you need to wait for the application to complete before continuing, then a different approach would be needed as follows:
import win32com.shell.shell as shell
import win32event
se_ret = shell.ShellExecuteEx(fMask=0x140, lpFile=r"D:\games\blender.lnk", nShow=1)
win32event.WaitForSingleObject(se_ret['hProcess'], -1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With