Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords:
Obj = ObjectCollectionNext(hEnum)It would (did) sit there for days if I left it. It hung when compiled (that's when I noticed it) and it also hangs when I run it though WB-Studio and stepping into each line.
CurServer = "RF2SZWDB12N1" Locator = ObjectOpen("WbemScripting.SWbemLocator") Service = Locator.ConnectServer(CurServer,"root/cimv2","UserName","Password") Security = Service.Security_ Security.ImpersonationLevel = 3 Class = "Win32_ComputerSystem" Instance = Service.InstancesOf(Class) hEnum = ObjectCollectionOpen(Instance) Obj = ObjectCollectionNext(hEnum) Txt = Obj.Manufacturer Message("Manuf",Txt) ObjectCollectionClose(hEnum) ObjectClose(Instance) ObjectClose(Security) ObjectClose(Service) ObjectClose(Locator) There are no errors recorded in a debug trace e.g. CurServer = "RF2SZWDB12N1" (10) VALUE=> "RF2SZWDB12N1" Locator = ObjectOpen("WbemScripting.SWbemLocator") (30) VALUE=> 33333 Service = Locator.ConnectServer(CurServer,"root/cimv2","Username","Password") (211) VALUE=> 33334 Security = Service.Security_ (211) VALUE=> 33335 Security.ImpersonationLevel = 3 (211) VALUE=> 3 Class = "Win32_ComputerSystem" (211) VALUE=> "Win32_ComputerSystem" Instance = Service.InstancesOf(Class) (251) VALUE=> 33336 hEnum = ObjectCollectionOpen(Instance) (251) VALUE=> 18243968Any chance of getting a timeout value written in to the function, or can you think of other reasons why it would be hanging?
See if you can use the WMI Object Browser to browse to that same remote machine and access the Manufacturer information....
Let us know the results.
Article ID: W15365
File Created: 2002:09:05:13:51:28
Last Updated: 2002:09:05:13:51:28