0

我在任务计划程序中创建了一个任务。

它基本上是一个必须在交互模式下运行的 powershell 脚本。

任务在 SYSTEM 帐户下运行。

在操作选项卡的程序/脚本下,我添加了 ServiceUI.exe 的路径,例如 C:* * \ServiceUI.exe 在添加参数选项下,我添加了 C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell。 exe -Windowstyle hidden -NoProfile -Executionpolicy bypass -file "C:**\PS1.ps1"

当我运行任务时,powershell 窗口提示会显示几分之一秒。

有人可以建议一种隐藏它的方法吗?

4

1 回答 1

0

我能够通过使用 vb 脚本来解决这个问题。

WScript.Quit CreateObject("WScript.Shell").Run("powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File" & PSscriptPath, 0, true)

在 Actions 选项卡中,在 Program/Script 下,我有 ServiceUI.exe 的路径,例如 C:**\ServiceUI.exe

在参数选项中添加了 wscript.exe“vbs 脚本路径”。

Powershell 提示没有出现,并且任务在使用这些选项的 SYSTEM 帐户下的交互模式下完美运行。

于 2021-09-28T12:38:54.497 回答