Problem with - WMI()

kath nitte.sudhir at
Wed Sep 27 18:21:38 CEST 2006


the following is code snippet I used to run plink command from Python.
If I run plink command directly it pops out a command prompt window. To
make the command promot window invisible I used WMI as follows. The
command runs perfect. But it throughs the error following the code

def run_command():
   cmd="plink -v -N -batch -l username-pw password-L
   c = wmi.WMI ()
   startup = (ShowWindow=win32con.SW_HIDE)
   pid, result =


FutureWarning: hex()/oct() of negative int will return a signed string
in Python 2.4 and up
Unhandled exception in thread started by <function run_command at
Traceback (most recent call last):
  File "", line 159, in run_command
  File "wmi.pyc", line 975, in connect
  File "wmi.pyc", line 220, in handle_com_error
wmi.x_wmi: 0x800401e4 - Invalid syntax

Can anyone tell me why is this error arising. And can avoid this error.

Thank you,

More information about the Python-list mailing list