使用python创建文件夹快捷方式

tech2025-08-24  5

import winshell my_working = "D:\\p\\s" # 源文件 link_filepath = "D:\\s.lnk" # 快捷方式名称 with winshell.shortcut(link_filepath) as link: link.path = my_working

import winshell import pythoncom path= "D:\\s.lnk" target= "D:\\p\\s" pythoncom.CoInitialize() winshell.CreateShortcut(Path=path, Target=target)

参阅winshell homepage

import os os.symlink("D:\\p\\s", "D:\\s")
最新回复(0)