Break OnDim $SO$SO=SetOption('Explicit','On')$SO=SetOption('NoVarsInStrings','On')$SO=SetOption('NoMacrosInStrings','On') Dim $VMRunning,$Item$VMRunning = VMwareRunning()If @ERROR 'Error checking VMware Service State. ' + @ERROR + ' - ' + @SERROR ?Else For Each $Item In $VMRunning If $Item $Item ? EndIf NextEndIf Function VMwareRunning() Dim $VMTools $VMTools = 0 Dim $VMProcess $VMProcess = 0 Dim $VMToolsRunning $VMToolsRunning = 0 Dim $Key, $ChkWMI $Key = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' $VMTools = ReadValue($Key,'VMware Tools') $VMProcess = ReadValue($Key,'VMware User Process') If 1 = KeyExist('HKLM\SYSTEM\CurrentControlSet\Services\VMTools') $ChkWMI = WMIConfirm() If @ERROR Exit @ERROR Else If $ChkWMI > 1 $VMToolsRunning = fnWMIService('VMTools','STATE') EndIf EndIf Else $VMwareRunning = 0 EndIf $VMwareRunning = $VMTools, $VMProcess, $VMToolsRunningEndFunction Function WMIConfirm(optional $sComputer) Dim $objWMIService, $objWMISetting, $colWMISettings $sComputer = IIf(Not $sComputer,'','\\'+Join(Split($sComputer,'\'),'',3)+'\') $objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!"+$sComputer+'root\cimv2') ; Failed - return 0 and exit with error value If @ERROR $WMIConfirm = 0 Exit Val('&' + Right(DecToHex(@ERROR), 4)) EndIf $colWMISettings = $objWMIService.ExecQuery("Select * from Win32_WMISetting") For Each $objWMISetting In $colWMISettings $WMIConfirm = $objWMISetting.BuildVersion Next Exit 0EndFunction Function fnWMIService($sService,$sMethod,Optional $sComputer) Dim $objWMI,$objSrvc,$nul If Not $sComputer $sComputer=@WKSTA EndIf $objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"+$sComputer+"\root\cimv2") If @ERROR<0 Exit VAL("&"+Right(DecToHex(@ERROR),4)) EndIf $objSrvc = $objWMI.ExecQuery('Select * from Win32_Service WHERE Name = "'+$sService+'"') For Each $objSrvc in $objSrvc $nul=Execute("$"+"fnWMIService = $"+"objSrvc."+$sMethod) NextEndFunction
Generated in 0.116 seconds in which 0.049 seconds were spent on a total of 13 queries. Zlib compression enabled.
") !=-1) { tempah=tempah.substring(tempah.indexOf("")+5,tempah.indexOf("")); codes[i].innerHTML="" + dotag(tempah.substring()) + ""; } } //var pres = document.getElementsByTagName("pre"); //for (var i=0, maxi = pres.length; i < maxi; i++) { // var tempah = pres[i].innerHTML; // if (tempah.indexOf("[postprep") !=-1) { // tempah=tempah.substring((tempah.indexOf("]",tempah.indexOf("[postprep"))+1)); // pres[i].innerHTML=dotag(tempah); // } //} function ytag(which_one) { var codes = document.getElementsByClassName("ubbcode-body"); var thisone = codes[which_one].innerHTML; codes[which_one].innerHTML = "" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf(""))) + ""; var heads = document.getElementsByClassName("ubbcode-header"); heads[which_one].innerHTML = "Code:" + ' '; } function ttag(which_one) { var codes = document.getElementsByClassName("ubbcode-body"); var thisone = ""; if (codes[which_one].innerText != undefined) { thisone += codes[which_one].innerText; } else { thisone += codes[which_one].textContent; } codes[which_one].innerHTML = thisone + ""; var heads = document.getElementsByClassName("ubbcode-header"); heads[which_one].innerHTML = "Code:" + ' '; }
")+5,tempah.indexOf("
" + dotag(tempah.substring()) + "
" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf(""))) + "
"),thisone.indexOf("
"; if (codes[which_one].innerText != undefined) { thisone += codes[which_one].innerText; } else { thisone += codes[which_one].textContent; } codes[which_one].innerHTML = thisone + "