Powershell 创建快捷方式
164 字
1 分钟
Powershell 创建快捷方式
Powershell 创建快捷方式
# 创建一个 名称为 "MyShortcut.lnk" 的快捷方式 打开 UWP 软件 "终端"$TargetFile = "C:\Windows\explorer.exe"$ShortcutFile = "$env:USERPROFILE\Desktop\MyShortcut.lnk"$WScriptShell = New-Object -ComObject WScript.Shell$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)$Shortcut.Arguments="shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App"$Shortcut.TargetPath = $TargetFile$Shortcut.Save()参数说明
Arguments : 参数Description : 描述Hotkey : 快捷键IconLocation : 图标位置TargetPath : 目标位置WindowStyle : 程序的窗口样式WorkingDirectory : 工作目录WindowStyle 说明
| WindowStyle | 说明 |
|---|---|
| 1 | 激活并显示窗口。如果该窗口被最小化或最大化,则系统将其还原到初始大小和位置。 |
| 3 | 激活窗口并将其显示为最大化窗口。 |
| 7 | 最小化窗口并激活下一个顶级窗口。 |
文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
Powershell 创建快捷方式
https://www.satxm.top/posts/powershell-shortcut/ 最后更新于 2025-11-30,距今已过 97 天
部分内容可能已过时
相关文章 智能推荐
1
在 Powershell 中创建符号链接
Powershell 在 Powershell 中创建符号链接
2
文件与 Base64 相互转换
Powershell 在 Powershell 中实现文件与 Base64 相互转换
3
Office 将编号转换为文本
Word Office 将编号转换为文本
4
命令行颜色代码
Windows 命令行颜色代码
5
恢复经典资源管理器和右键菜单
Windows 恢复 Windows 11 经典资源管理器和右键菜单
随机文章 随机推荐