Jump to content

Object Issues


Recommended Posts

Any ideas or solutions for this?

$Objwmiservice = ObjGet ("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
   $Colsettings = $objWMIService.ExecQuery ("Select * from Win32_Processor")
   For $Objprocessor In $Colsettings

Works fine in XP but throws a "Must be an object" error at

$Objwmiservice = ObjGet ("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$Colsettings = $objWMIService.E

when used in 98 and I would imagine it's the same in the other 9x systems.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

im going with becuase its windows, thats why it doesnt work and its OLD :think:

Except that if I run the original VB code it works fine.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Any ideas or solutions for this?

$Objwmiservice = ObjGet ("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
   $Colsettings = $objWMIService.ExecQuery ("Select * from Win32_Processor")
   For $Objprocessor In $Colsettings

Works fine in XP but throws a "Must be an object" error at

$Objwmiservice = ObjGet ("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$Colsettings = $objWMIService.E

when used in 98 and I would imagine it's the same in the other 9x systems.

You need WMI :

http://msdn.microsoft.com/library/default...._start_page.asp

Download WMI CORE 1.5 (Windows 95/98) here:

http://www.microsoft.com/downloads/release...ReleaseID=18492

Platform SDK: Windows Management Instrumentation

Automatically Invoking WMI on Windows 95/98

The Windows Management service starts automatically on computers running Microsoft® Windows NT®/Microsoft® Windows® 2000, but not on computers running Windows 95/98. To set up the Windows Management service to start automatically on a Windows 95/98 system, you must make the following changes to the operating system registry.

To set up the Windows Management service to run automatically on a computer running Windows 95/98

In the registry, navigate to the value named EnableRemoteConnect?.

Under the key HKLM\SOFTWARE\MICROSOFT\OLE, set EnableDCOM? to "Y" if it is not set to "Y" already. "Y" is the default setting.

In the registry under the key HKLM\SOFTWARE\MICROSOFT\OLE, set EnableRemoteConnect? to "Y". The default setting for the EnableRemoteConnect? value is "N" for Windows 95/98 systems.

Place the following entry in the registry to enable the WMI automatic start feature:

HKLM\SOFTWARE\Microsoft\wbem\cimom - AutostartWin9X

Set the AutostartWin9x value to either "1" or "2". The following table lists possible values for AutostartWin9x and their meanings. Value Meaning

"0" Manual

Use this setting when you do not need the service running continuously. When a local request comes in, WMI starts to service the request. If you later restart the computer, the computer will start in manual mode (WMI will not start automatically).

Note that remote startup requests are only supported on Windows NT/Windows 2000. Remote startup requests are not supported by COM on Windows 95/98.

"1" Automatic if the computer system needs to reload

Use this setting if you would normally have active event consumers. If WMI has active event consumers and the system (any system that supports WMI) needs to be restarted, WMI starts automatically after the system starts.

"2" Automatic

Windows Management service always starts automatically.

Link to comment
Share on other sites

You need WMI :

Thanks Lapo, I'll play with it in the morning I've been at this computer for 16 hrs today and that's enough.

I'll let you know the results

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Thanks for all that info Lapo. That was the right answer. It also gave me some disturbing news :think: WMI is also not installed with Windows 2000 so that made the work-around a bit more tedious. In Win9x Systems there are registry keys that will give me most of the information that I was recovering in XP by using WMI objects but I'm not sure if those same keys are in Win 2000 or not. My origional idea was to use

If @OSType = 'WIN32_NT' Then
use the wmi calls
Else
use the registry entries
EndIf
That won't work because Win 2000 reports as 'Win32_NT'. The only way I've worked on that seems to work is to search for one of the WMI dll files and if it exists then use the WMI code and if not use the registry code. As long as it works I'm happy. :(

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I don't have WMI installed here on a win98se

IMHO you can do ALL without WMI also on a winXp/2000

edit:

C:\PROGRA~1\AUTOIT3\AUTOIT3.CHM

RunAsSet and ProcessList

Edited by Lapo
Link to comment
Share on other sites

There are some things that I included in the script that can't be read from the registry so without WMI they will just be ignored or given an unknown vale. But you are right, There are somethings that I can read from the registry in 98 that you can't get from the XP registry and you can't always get them using WMI. For example, with my motherboard WMI will not return the Make & Model but I can read it fine in the 98SE registry. I installed WMI on the 98 partition to play with this script and now I have to go and stop it from running so I can finish working on the rest of the non-WMI functions.

Thanks again for the help.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...