当前位置:   article > 正文

python --windows创建软链接(快捷方式)_windows python os创建快捷方式

windows python os创建快捷方式
from win32com.client import Dispatch

path = r"D:\mojoy.lnk"  # Path to be saved (shortcut)
target = r"D:\video_frame\mojoy\mojoy.exe"  # The shortcut target file or folder
work_dir = r"D:\video_frame\mojoy"  # The parent folder of your file
shell = Dispatch('WScript.Shell')
shortcut = shell.CreateShortCut(path)
shortcut.Targetpath = target
shortcut.WorkingDirectory = work_dir
shortcut.save()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/264762
推荐阅读
相关标签
  

闽ICP备14008679号