473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem with - WMI()

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,ProcessStar tupInformation=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.

Sep 27 '06 #1
0 954

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Fazan | last post by:
I'm using Tim Golden's WMI implementation (http://tgolden.sc.sabren.com/python/wmi.html) version 0.6 along with pywin32 build 202. I'm able to successfully query WMI in the main thread but not in...
6
by: EW | last post by:
I have a problem when using the python script found here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/360649 It is a script to remotely shutdown a windows computer. When I use it,...
5
by: Jean-Sébastien Guay | last post by:
Hello, I'm pretty new to Python, though I have a fair bit of experience with C/C++, Java, Perl, PHP and others. I installed Tim Golden's wmi module...
5
by: Data | last post by:
In my project I want to execute some commands on the remote machine. I am using .Net Remoting to achieve this. My server which is an exe is copied on the remote machine and it receives command from...
2
by: Paul Steele | last post by:
I have some code that uses the WMI class win32_NetworkAdapterConfiguration to access each adapter in a system. On 99% of the systems the code seems to work. On a very few the code fails when trying...
11
by: Claude Henchoz | last post by:
Hi Is there any way of listing partitions on a (win32) computer without using WMI? Cheers, Claude
7
by: Salvador | last post by:
Hi, I am using WMI to gather information about different computers (using win2K and win 2K3), checking common classes and also WMI load balance. My application runs every 1 minute and reports...
2
by: Vadim Malishev | last post by:
Hello, Can anybody help to solve the following problem? My Windows Service trying to access remote machine to get WindowsDirectory Property over Win32_OperatingSystem WMI class. Both servers...
25
by: patrol | last post by:
I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate "scrcons.exe" and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.