直接代码:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import pythoncom

def GetURLFromShortcut(url):
    shortcut = pythoncom.CoCreateInstance(
                                shell.CLSID_ShellLink, None,
        			pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink)
    shortcut.QueryInterface( pythoncom.IID_IPersistFile ).Load(url)
    url = shortcut.GetPath(shell.SLGP_SHORTPATH)[0]

    return url