Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Pull the Machine's Manufacturer, Model and Serial Number WMI
#DefineFunction GetWMIInfo() IntControl(73, 2,0,0,0) Locator = ObjectOpen("WbemScripting.SWbemLocator") Service = Locator.ConnectServer() Security = Service.Security_ Security.ImpersonationLevel = 3 Class = "Win32_ComputerSystemProduct" Instance = Service.InstancesOf(Class) Enum = ObjectCollectionOpen(Instance) While 1 Obj = ObjectCollectionNext(Enum) If Obj == 0 Then Break man=Obj.Vendor model=Obj.Name serial=Obj.IdentifyingNumber EndWhile ObjectCollectionClose(Enum) ObjectClose(Instance) ObjectClose(Security) ObjectClose(Service) ObjectClose(Locator) data=StrCat(man,@TAB,model,@TAB,serial) Return(data) :WBERRORHANDLER Error=LastError() Terminate(error!=3246,"Error %error%",StrCat(wberrorhandlerline,@CRLF,IntControl(34,error,0,0,0))) %wberrorhandlerassignment%="Not Found" IntControl(73, 2,0,0,0) Return #EndFunction datax=GetWmiInfo() AskItemlist("",datax,@TAB,@UNSORTED,@SINGLE)
Article ID: W15787
File Created: 2003:05:13:11:30:06
Last Updated: 2003:05:13:11:30:06