我有一个启动powerShell脚本的bat文件。我希望bat文件在启动脚本后继续移动,而不是等待powerShell脚本完成。每次当我启动powerShell脚本时,bat文件都要等到powerShell脚本执行完毕后才会继续执行。下面是我调用powerShell脚本的方式:
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "&'C:\Users\sharph\Desktop\test.ps1'"发布于 2016-03-05 02:49:19
您需要使用start命令启动它,如下所示;
start "" "PowerShell"这将在不等待程序关闭的情况下启动程序,尽管可以使用/w或/wait选项重新添加该行为。空白的""代替了标题,并不总是需要的,但添加起来通常是安全的。
也许这能行得通?
start "" "PowerShell" -NoProfile -ExecutionPolicy Bypass -Command "^& 'C:\Users\sharph\Desktop\test.ps1'"当然,必须将&分隔为^&。
https://stackoverflow.com/questions/35803668
复制相似问题