![](/img/trans.png)
[英]can't using Start-Process powershell.exe run a ps1 file at onedrive path
[英]Powershell Start-Process works but not from .ps1 script
如果我将此粘贴到Powershell蓝色窗口中,它将运行正常并启动程序
Start-Process “C:\Program Files (x86)\Engine Pro\engine.exe” -ArgumentList "#21#”;
但是,如果我尝试在Windows计划任务中启动的脚本run.ps1脚本中运行相同的命令,则不会执行任何操作
PowerShell.exe -windowstyle hidden -NoProfile -ExecutionPolicy Bypass C:\run.ps1
它与-ExecutionPolicy绕过有关吗? 脚本中也必须有执行策略吗? 我真的不知道那是什么 我知道-windowstyle隐藏了什么,但-NoProfile -ExecutionPolicy绕过我不确定为什么会出现,只是在另一页上找到了它,但是除了从脚本中启动程序之外,其他所有功能都可以正常工作。
谢谢。
& Start-Process "C:\Program Files (x86)\Engine Pro\engine.exe" -ArgumentList "#21#";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.