#目标文件路径,$home获取本用户路径
$ShortcutFile = “$home/Desktop/文件名称.lnk”
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
#源文件路径带后缀
$Shortcut.TargetPath = “源文件路径“
$Shortcut.Save()
原创文章,作者:306829225,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/271606.html