[英]Powershell Script converted to EXE via Win-PS2EXE can be run manually but errors out when run as a scheduled task
The application moves files from one directory to another, runs an exe, and then moves files from one directory to another. 该应用程序将文件从一个目录移动到另一个目录,运行exe,然后将文件从一个目录移动到另一个目录。
When I run the application manually it works as expected. 当我手动运行该应用程序时,它可以按预期工作。
However, when trying to run it as a scheduled task I get the following error: 3762504530 但是,尝试将其作为计划任务运行时,出现以下错误:3762504530
I did some researching and it appears it may have to do with the application trying to run interactively even when there is no user actually logged in. 我做了一些研究,似乎与尝试以交互方式运行的应用程序有关,即使实际上没有用户登录也是如此。
I have tried to suppress outputs but that didn't seem to have any effect. 我试图抑制输出,但这似乎没有任何效果。
如果您不希望看到代码,我想您使用控制台输出或类似的命令...如果这样,将write-host更改为write-output或别名“ echo”,如果您希望将其管道传输到日志文件中,请确保您的脚本运行“ non互动”(无提示等)
取消选中编译图形Windows程序(参数-noConsole),可纠正该错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.