title: How Can I Find The Current Windows Defender Executable Location? And Why Are There Many?
body: <p>Microsoft has multiple versions of the Defender executable (MpCmdRun.exe) installed on my computer.  There is an obvious one in &quot;C:\Program Files\Windows Defender\MpCmdRun.exe&quot; but then two others in &quot;C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2010.7-0\MpCmdRun.exe&quot; and &quot;C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2011.6-0\MpCmdRun.exe&quot;.  <em>The folders all have different versions of MpCmdRun.exe</em>.</p>
  <p>Per <a href="https://support.microsoft.com/en-us/help/4052623/update-for-microsoft-defender-antimalware-platform" rel="nofollow noreferrer">Microsoft</a>, the latest version is the 4.18.2011.6-0 version, but how would I know this if I hadn't researched?  And if I encode some dependency on this location (see below), how would I know when it's been superceded?</p>
  <p>My goal is to create a custom scheduled task for Defender that runs full scans rather than quick scans.  I tried whacking on the existing Windows Defender task definitions (in Task Scheduler -&gt; Task Scheduler Library -&gt; Microsoft -&gt; Windows -&gt; Windows Defender), but the tasks periodically modify themselves (after updates, etc.) and my changes are lost.  I can readily create my own custom task, but I have to know the location of MpCmdRun.exe which, as I pointed out above, seems to move around.</p>
  <p>Does anyone know of a reliable way to determine what the location of the latest Defender executable is, preferably easy enough to use in a command line?</p>
  <p>Also, anyone have any clues about why Microsoft did it this way?  Why not just keep the latest version in &quot;C:\Program Files\Windows Defender&quot;?  And why leave old version laying around?</p>