【发布时间】:2026-01-03 06:10:02
【问题描述】:
我正在启动一个带有 powershell 快捷方式的脚本(C:\Windows....\powershell.exe -file 'D:\powershell\script.ps1')。
有没有办法让脚本将其当前位置更改为所述快捷方式的位置?
示例:脚本本身位于 D:\powershell\ 中,快捷方式位于 C:\Work\Project1 中。我需要将脚本 cd 到“C:\Work\Project1\”。
谢谢
【问题讨论】:
标签: windows powershell desktop-shortcut