By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,171 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

python create WMI instances

P: n/a
Hi all, I am struggling with a vb - python code conversion. I'm using
WMI to create printers on remote machines using (in VB);

set oPrinter = oService.Get("Win32_Printer").SpawnInstance_

oPrinter.DriverName = strDriver
oPrinter.PortName = strPort
oPrinter.DeviceID = strPrinter
oPrinter.Put_(kFlagCreateOnly)

In python I have logged onto the WMI service on the remote machine and
I can run things like c.new.AddPrinterConnection so I know that I am
connected and working OK. I don't get any errors when I create a new
object with SpawnInstance_ but when I try to set the value of
oPrinter.Drivername I get an error saying that the Drivername object
doesn't exist. Does anyone know how to set the values of the object
using either the method above or with the WMI module? I think the WMI
module only allows access to modify methods such ADDPrinterConnection
or Create (from Win32_Service).

Thanks,MW.
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.