python 对外部程序的调用导致 [错误 193] %1 不是有效的 Win32 应用程序 [英] python Call to external program results in [Error 193] %1 is not a valid Win32 application

查看:83
本文介绍了python 对外部程序的调用导致 [错误 193] %1 不是有效的 Win32 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 GUI 前端,在它进行一系列验证后,将执行一系列已经存在的 vbscript .wsf 文件.

I am writing a GUI front end that after it does a bunch of validation will execute a series of already existing vbscript .wsf files.

我的问题是当我尝试执行 .wsf 文件时出现错误

My problem is when I try to execute the .wsf files I get the error

WindowsError:  [Error 193] %1 is not a valid Win32 application

从命令行运行它们可以正常工作

Running them from the command line works fine

d:\<some path>\<some file>.wsf

我尝试了几种不同的选项,调用、os.system 等.但都导致相同的 Win32 错误.

I have tried several different options, call, os.system etc. But all result in the same Win32 error.

call("d:\<some path>\<some file>.wsf")

有什么想法吗?

推荐答案

正如警告所说,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.

这篇关于python 对外部程序的调用导致 [错误 193] %1 不是有效的 Win32 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆