Jump to content

DoGauss

Member
  • Posts

    1
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Germany

Everything posted by DoGauss

  1. For using wildcards in WMI you have to use the '%' character. But while using wildcards you also need to exchange the comparator from '=' to 'LIKE' so the result woult look like this: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name like '%.exe'") For Each objProcess in colProcessList objProcess.Terminate() Next Be sure to know what you do with this - with all *.exe processes terminated you *WILL* have to reboot the hard way because it's most likely that your current session will be beyond any bounds to get fixed and running stable again. Also keep in mind that you might stumble upon processes which do not like to be terminated this way. Greetings Dominik
×
×
  • Create New...