In this article I’ll explain the process of combining C++ and VBScript codes together. There are many situations in which you find yourself in desperate need of some simple code that can handle what your program wants to do. 216 more words
Tags » VBScript
This script will search the text in the comments, scenario’s and linked document of the selected elements for terms in the domain model. If it finds a match it will create a trace from your selected element to the element in the domain model. 2,501 more words
With this script you can change set all the lines styles on a diagram at once, to your preferred style per type of connector.
In Enterprise Architect you can choose from no less then 9 different line styles for the connectors. 912 more words
Tutorial: Generate complex documents from Enterprise Architect with a two-step semi-automated approach
- Step 1: Create the virtual document with a script
- Step 2: Generate the document from the virtual document
Document generation is important in most organisations that work with Enterprise Architect. 2,475 more words
Script for the monitor. Currently looking for Sophos antivirus service and system driver.
'Try with or without after you have tested outside of SCOM On Error Resume Next Dim oAPI, oBag Dim StrMntrStatus Set oAPI = CreateObject("MOM.ScriptAPI") Set oBag = oAPI.CreatePropertyBag() For testing 'strComputer = "xyz.domain.com" 'Monitor has to be set to receive DNS name as 1st parameter strComputer = WScript.Arguments(0) strrslt = "" ' String for debugging info strSvcPresent = "No" strSvcStatus = "None" strSysDriverPresent = "No" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_SystemDriver where Name='vsepflt'",,48) 'wscript.echo TypeName(colItems) if not isempty(colItems) then For Each objItem in colItems strSysDriverPresent = "Yes" Next 'wscript.echo strrslt else 'wscript.echo "Driver not installed" end if set colItems = Nothing Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where Name='SavService'",,48) For Each objItem in colItems strSvcPresent = "Yes" 'strSvcStatus = objItem.Status strSvcStatus = objItem.State Next strrslt = strrslt & vbcrlf & "strComputer: " & strComputer strrslt = strrslt & vbcrlf & "strSysDriverPresent: " & strSysDriverPresent strrslt = strrslt & vbcrlf & "strSvcPresent: " & strSvcPresent strrslt = strrslt & vbcrlf & "strSvcStatus: " & strSvcStatus Set objWMIService = Nothing set colItems = Nothing Call oBag.AddValue("Computer",strComputer) Call oBag.AddValue("SysDriverPresence",strSysDriverPresent) Call oBag.AddValue("SvcPresent",strSvcPresent) Call oBag.AddValue("SvcStatus",strSvcStatus) if ((strSvcPresent="Yes" and strSvcStatus="Running") or strSysDriverPresent="Yes") then Call oBag.AddValue("Status","OK") StrMntrStatus = "OK" elseif strSvcPresent="Yes" and strSysDriverPresent="Yes" then Call oBag.AddValue("Status","Warning") StrMntrStatus = "Warning" else Call oBag.AddValue("Status","Bad") StrMntrStatus = "Bad" end if Call oBag.AddValue("MntrStatus",StrMntrStatus) strrslt = strrslt & vbcrlf & "StrMntrStatus: " & StrMntrStatus wscript.echo strrslt Call oAPI.Return(oBag)
In this example we will delete files in all folders and keep the last 30 files for that have their creation or modifcation not older than 30 days ( 117 more words