我试图创建一个python可执行文件,它将运行多个wmic调用来检查可移植可执行文件的版本。在
以下代码在命令提示符下工作,因此我尝试从python运行同一行wmic datafile where name="C:\\Program Files\\Internet Explorer\\iexplore.exe" get Version /value
Python代码:
^{pr2}$
我得到以下错误---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
in ()
----> 1 process = subprocess.check_output(cargs)
c:\users\jhsiang\appdata\local\programs\python\python35\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs)
624
625 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 626 **kwargs).stdout
627
628
c:\users\jhsiang\appdata\local\programs\python\python35\lib\subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
706 if check and retcode:
7