简体   繁体   中英

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.

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

在此处输入图片说明

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),可纠正该错误。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM