473,320 Members | 1,856 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,320 software developers and data experts.

System.Management.ManagementException: Not found (Win 2K)

I have an application that uses the following code to return the
default printer:

Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject
moSearch = New Management.ManagementObjectSearcher("Select *
from Win32_Printer")
moReturn = moSearch.Get

For Each mo In moReturn

If mo("Default") Then
Return mo("Name")
Exit Function
End If

Debug.WriteLine(mo("Name"))

This works fine on my WINXP development machine, but when deployed to a
WIN2K machine, the following error is returned:
************** Exception Text **************
System.Management.ManagementException: Not found

at
System.Management.ManagementException.ThrowWithExt endedInfo(ManagementStatus
errorCode)
at System.Management.PropertyData.RefreshPropertyInfo ()
at System.Management.PropertyDataCollection.get_Item( String
propertyName)
at System.Management.ManagementBaseObject.GetProperty Value(String
propertyName)
at System.Management.ManagementBaseObject.get_Item(St ring
propertyName)
at IMPulseBatchPrintStandAlone.frmMain.IsDefaultPrint er(String
strPrinterName)
at IMPulseBatchPrintStandAlone.frmMain.PrintACADFiles (ArrayList
FileList)
at IMPulseBatchPrintStandAlone.frmMain.cmdPrint_Click (Object sender,
EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

From NG searches, it looks like perhaps a LOCAL SERVICE account

permissions issue accessing System.Management.dll. On the development
machine it has permissions, but it doesnt even show up in the WIN2K
machine, and I can't find it in the list to add it. Does anyone know
how to fix this?

Thanks.

- Luther

Nov 21 '05 #1
1 10188
"lcifers" <lc*****@yahoo.com> schrieb:
moSearch = New Management.ManagementObjectSearcher("Select *
from Win32_Printer")
moReturn = moSearch.Get

For Each mo In moReturn

If mo("Default") Then
Return mo("Name")
Exit Function
End If

Debug.WriteLine(mo("Name"))

This works fine on my WINXP development machine, but when deployed to a
WIN2K machine, the following error is returned:

************** Exception Text **************
System.Management.ManagementException: Not found


The 'Default' property is not supported on Windows 2000.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2

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

Similar topics

0
by: Ger | last post by:
Hi, I have a problem with a Windows Service that I have created accessing System.Management.dll on a W2k3 environment. The Service runs fine on an XP machine but the same Service causes an error...
0
by: Masood Siddiqi [MSFT] | last post by:
Hi, I am getting this exception Unhandled Exception: System.Management.ManagementException: COM object that has been separated from its underlying RCW can not be used. --->...
0
by: Eric Carr | last post by:
Hi, we have been using WMI from VB6 to automate configuration of new DNS zones on our win2000 servers, and are now trying to move the system to a vb.net application. We recently added some...
1
by: theintrepidfox | last post by:
Dear Group I wonder whether anyone has some information on the cause for this error? I've created a class for Win32_BIOS with mgmtclassgen Win32_BIOS /L VB, added the file to my VB.NET project...
2
by: Lamis | last post by:
Hi, I need urgent help, this is my code to rename my hostName: (MY computer is not member of domain) string compName = System.Windows.Forms.SystemInformation.ComputerName.ToString();...
8
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i trying to collect windows services. i'm getting inconsistencies. the collection works every time locally. but remote collection yields different result depending on my lab environment. 1) in...
0
by: =?Utf-8?B?YXBvY283Ng==?= | last post by:
Hello, I'm using WMI to query the Event Logs for a particular computer. This Event Log has over 400,000 entries. The application runs without errors until record 260,000 then it throws this...
0
by: kimiraikkonen | last post by:
On Jul 11, 10:07 pm, Michael<mtit...@bigfoot.comwrote: Hi Michael, There are several ways of retrieving, but some low-level hardware info is retrieved using WMI. To get basic system info such as...
2
by: karthi84 | last post by:
Hi Experts, i have created a web application which has an option to edit the web config file from the web page. when i create an installer for this project using web setup project in VS2008 and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.