python --解析windows快捷方式(pylnk)
- from pylnk import LnkFile
-
- # 指定快捷方式文件路径
- file_path = 'C:/Users/User/Desktop/Example.lnk'
-
- # 解析快捷方式文件
- lnk_file = LnkFile(file_path)
-
- # 获取目标路径
- target_path = lnk_file.get_link_target()
- print('目标路径:', target_path)
-
- # 获取参数
- arguments = lnk_file.get_link_arguments()
- print('参数:', arguments)
-
- # 获取工作目录
- working_directory = lnk_file.get_link_working_directory()
- print('工作目录:', working_directory)
-
- # 获取描述
- description = lnk_file.get_link_description()
- print('描述:', description)
-
- # 获取图标路径
- icon_location = lnk_file.get_link_icon_location()
- print('图标路径:', icon_location)
-
- # 获取图标索引
- icon_index = lnk_file.get_link_icon_index()
- print('图标索引:', icon_index)
-
- # 获取热键
- hotkey = lnk_file.get_link_hotkey()
- print('热键:', hotkey)
-
- # 获取显示命令
- show_command = lnk_file.get_link_show_command()
- print('显示命令:', show_command)
-
- # 获取创建时间
- creation_time = lnk_file.get_link_creation_time()
- print('创建时间:', creation_time)
-
- # 获取访问时间
- access_time = lnk_file.get_link_access_time()
- print('访问时间:', access_time)
-
- # 获取修改时间
- write_time = lnk_file.get_link_write_time()
- print('修改时间:', write_time)
-