RafaelFranckilin Posted March 13, 2020 at 12:07 PM Report Share #617582 Posted March 13, 2020 at 12:07 PM (edited) Pessoal, preciso obter o status de windows defender(on/off), mas não sei como fazer isso com o vb.net, Estou usando esse código, mas não é exatamente como eu quero. Vocês podem me ajudar com algo mais simples? Dim av_searcher As New ManagementObjectSearcher("root\SecurityCenter2", "SELECT * FROM AntivirusProduct") For Each info As ManagementObject In av_searcher.Get() MsgBox(info.Properties("displayName").Value.ToString()) Dim AvStatus = Hex(info.Properties("ProductState").Value.ToString()) If Mid(AvStatus, 2, 2) = "10" Or Mid(AvStatus, 2, 2) = "11" Then MsgBox("AntiVirus enabled") ElseIf Mid(AvStatus, 2, 2) = "00" Or Mid(AvStatus, 2, 2) = "01" Then MsgBox("AntiVirus disabled") End If Next info Edited March 13, 2020 at 12:08 PM by RafaelFranckilin Link to comment Share on other sites More sharing options...
Gonçalo Silva Posted March 13, 2020 at 04:15 PM Report Share #617585 Posted March 13, 2020 at 04:15 PM Não programo em VB mas tenho muitas dúvidas que consigas arranjar código muito mais simples do que esse. Além disso tem cuidado que esse código pode não funcionar em todas as versões do windows. 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