launcher_lnk.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:wahcade 作者: sairuk 项目源码 文件源码
def read_scexec(scfile):
    """ read shortcut and return executable path """
    if sys.platform != 'win32':
        return "Only available for windows platforms! returning"
    try:
        import pythoncom
        from win32com.shell import shell, shellcon
    except:
        return "pythoncom module not found! \n download from http://sourceforge.net/projects/pywin32/files/pywin32/"
    shortcut = pythoncom.CoCreateInstance (
      shell.CLSID_ShellLink,
      None,
      pythoncom.CLSCTX_INPROC_SERVER,
      shell.IID_IShellLink
    )
    shortcut.QueryInterface (pythoncom.IID_IPersistFile).Load (scfile, 0)
    cmd, _ = shortcut.GetPath (shell.SLGP_UNCPRIORITY)
    args = shortcut.GetArguments ()
    work_dir = shortcut.GetWorkingDirectory()    
    return "Executing " + cmd, cmd, args, work_dir, False, False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号