简体   繁体   English

通过Win-PS2EXE转换为EXE的Powershell脚本可以手动运行,但作为计划任务运行时会出错

[英]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.

相关问题 作为系统的计划任务运行时,cmd.exe会流血 - cmd.exe bleeding through when run as scheduled task as SYSTEM 使用py2 exe将脚本转换为.exe,但是当我运行.exe时,什么也没发生? - converted script to .exe with py2 exe but when I run .exe nothing happens? 通过任务计划程序运行.bat脚本时,如何防止显示cmd.exe窗口? - How can I prevent a cmd.exe window from showing when a .bat script is run via Task Scheduler? Powershell 脚本不通过计划任务运行 - Powershell script does not run via Scheduled Tasks Powershell脚本用参数运行exe文件 - Powershell Script to run exe file with parameters IntelliJ可以通过bash.exe而不是Windows cmd.exe运行gradle任务吗? - Can IntelliJ run gradle task via bash.exe rather than Windows cmd.exe? 使用Windows Task Scheduler运行的PowerShell脚本未运行SQL Server SSIS DTEXEC.EXE作业 - PowerShell script run using Windows Task Scheduler is not running a SQL Server SSIS DTEXEC.EXE job Windows .exe GUI应用程序可以转换为DLL,然后运行GUI吗? - Can a Windows .exe GUI application be converted to DLL, and then run the GUI? 以Scheduled Task Powershell脚本运行时Chromium源下载错误 - Chromium source download errors when running as Scheduled Task Powershell script 通过计划任务执行时,PowerShell脚本产生奇怪的结果 - Strange result from powershell script when executing via scheduled task
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM