Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


WMI Enabled UDF

Keywords:  WMI Enabled UDF  WMI_Enabled

#defineFunction WMI_Enabled()
   IntControl(73,1,0,0,0)
   Locator = ObjectOpen("WbemScripting.SWbemLocator")
   Service = Locator.ConnectServer()
   Security = Service.Security_
   ObjectClose(Security)
   ObjectClose(Locator)
   Return @TRUE
   
   :WBERRORHANDLER
   LastError()
   Return @FALSE
#endfunction

;Check if WMI is enabled
flag=WMI_Enabled()
Message("Return Value",flag)