gpt4 book ai didi

powershell - 如何在 runonce-Key 中运行 powershell 脚本?

转载 作者:行者123 更新时间:2023-12-04 02:08:40 24 4
gpt4 key购买 nike

我有一个看起来像这样的 powershell.exe 调用,它在我的命令行中工作:

powershell.exe -noexit -command " & 'C:\Test\test.ps1' "

但是,当我在当前用户的 runonce-key 中完全以这种方式输入该条目时,没有任何 react 。

从 runonce 或 run 调用 powershell.exe 传递参数的正确方法是什么?

最佳答案

尝试使用完整路径:

c:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -noexit "C:\Test\test.ps1" 

或者
c:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command " & 'C:\Test\test.ps1' " 

关于powershell - 如何在 runonce-Key 中运行 powershell 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11120104/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com