2025年3月27日 星期四 甲辰(龙)年 月廿六 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 编程开发 > Python

python --解析windows快捷方式(pylnk)

时间:08-03来源:作者:点击数:27
城东书院 www.cdsy.xyz

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)
城东书院 www.cdsy.xyz
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门
本栏推荐