![](/img/trans.png)
[英]Visual basic to open a folder with the window in a specific location?
[英]Finding the "location" of the PowerShell window open
所以我正在使用 VBA 在 PowerPoint 中制作一个小的“编辑器”,我想知道是否有办法获取特定打开的 PowerShell 窗口的位置/文件路径。 我希望能够使用 VBA 在特定文件夹中打开 PowerShell。
您可以直接在 VBA 中运行PowerShell
命令:
Cmd = "PowerShell -Command ""{Your Command}"""
Shell(Cmd, vbNormalFocus)
或者您也可以从文件夹执行脚本:
Shell("PowerShell ""Script Path"", vbNormalFocus)
因此,您可以采用的一种解决方法是直接在 VBA 中执行 shell,并在 VBA cmd 字符串中指定所需的路径。
另外,我认为这可以帮助你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.