且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

python 对外部程序的调用导致 [错误 193] %1 不是有效的 Win32 应用程序

更新时间:2021-12-30 00:05:45

正如警告所说,file.wsf 不是应用程序.这是一个通过作为参数传递给脚本引擎来运行的脚本.您可能需要改为调用脚本处理程序.我不知道处理程序应用程序是什么,但让我们假设它是 cscript.exe.您应该调整您的 call() 以运行它并将 wsf 文件作为参数传递.

As the warning says, file.wsf isn't an application. It's a script that gets run by being passed as an argument to the script engine. You'll probably need to call the script handler instead. I've no idea what the handler application is, but let's assume that it's cscript.exe. You should adjust your call() to run this and pass the wsf file as a parameter.