ChrisL Posted November 22, 2006 Share Posted November 22, 2006 A quick question, what is the best way to check if WMI is available in a script? What would happen if you ran script which tried to querry some WMI stuff but WMI didn't exist? [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
GaryFrost Posted November 22, 2006 Share Posted November 22, 2006 $strComputer = 'localhost' $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") If @error Then MsgBox(0,"Error", "Couldn't connect to WMI") Exit EndIf SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
ChrisL Posted November 22, 2006 Author Share Posted November 22, 2006 $strComputer = 'localhost' $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") If @error Then MsgBox(0,"Error", "Couldn't connect to WMI") Exit EndIf Thanks [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
idbirch Posted July 29, 2008 Share Posted July 29, 2008 Is there anyway to make the check give up quicker if a machine is slow to respond or not going to respond? For some machines I run this on, it takes ~30 seconds to time out. If not, could a timer be implemented somehow to cancel the call if no response if received? Link to comment Share on other sites More sharing options...
rasim Posted July 29, 2008 Share Posted July 29, 2008 idbirchTimerInit() TimerDiff()P.S.In the future time create your own topic. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now