I am trying to write a batch file to find antivirus installed on Windows 7,8,10.
The need is like the project is trying to change firewall rules as per requirement for client machines.
The clients who are windows machines should have a firewall configured with certain rules.
I get the error as the firewall is managed by antivirus software. To uninstall I have written the following:
@echo off
setlocal enabledelayedexpansion
set "i=0"
for /F "delims=" %%f in ('wmic /node:localhost /namespace:\root\SecurityCenter2 path AntiVirusProduct Get DisplayName ^| findstr /V /B /C:displayName ^| findstr /V /R /C:"^[ ]*$"') do (
set arr[!i!]=%%f
set /a "i+=1"
)
set arr
set "len=!i!"
set "i=1"
:loop
echo !arr[%i%]!
wmic product where "description='!arr[%i%]'" uninstall
set /a "i+=1"
if %i% neq %len% (
goto:loop
)
endlocal
But this is not working.
Can somebody help me how to do it(for any antivirus)?