Problem with - WMI()

K

kath

Hi,

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
snipet.

def run_command():
cmd="plink -v -N -batch -l username-pw password-L
3307:127.0.0.1:3306 dbb.mydatabase.com"
c = wmi.WMI ()
startup = c.Win32_ProcessStartup.new (ShowWindow=win32con.SW_HIDE)
pid, result =
c.Win32_Process.Create(CommandLine=cmd,ProcessStartupInformation=startup)


D:\...\...\library.zip\wmi.py:215:

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
0x00D05130>
Traceback (most recent call last):
File "newfma.py", 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,
sudhir.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top