Please help with replace string
When I get the Dell model number it comes out as Latitude E5430 non-vPro
I would like to strip out the words Latitude & non-vPro
NOTE: E5430 may be any Dell Model not specifically that one.
Was thinking of something like below but not working
If it could be done with an array or dictionary so I could add other words to it if need be.
Thanks
wscript.echo model
MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
When I get the Dell model number it comes out as Latitude E5430 non-vPro
I would like to strip out the words Latitude & non-vPro
NOTE: E5430 may be any Dell Model not specifically that one.
Was thinking of something like below but not working
If it could be done with an array or dictionary so I could add other words to it if need be.
Thanks
Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
For Each objComputer in objWMI.ExecQuery("Select * from Win32_ComputerSystem")
model = trim(replace(objComputer.Model, ",", "."))
if InStr(objComputer.Model,"Latitude" & "non-vPro") then
model = TRIM(replace(objComputer.Model,InStr(objComputer.Model,"Latitude" & "non-vPro")))
end if
Next
wscript.echo model
MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP