Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query.
The exit code 2 from MpCmdRun.exe (Windows Defender Command-line tool) indicates that the command has failed. When this error occurs while running the tool under the System account, it could be caused by a few different issues. Here are a few troubleshooting steps you can try:
- Check the command syntax: Make sure that the command you are using is correct and that all the required arguments are being passed to the tool. You can refer to the official documentation of MpCmdRun.exe to ensure that the command is being used correctly.
- Check the permissions: Make sure that the System account has the necessary permissions to run the MpCmdRun.exe. By default, the System account has full permissions on the system, but in case if there is any restriction or group policy that is preventing it from running the command.
- Check the Windows defender status: Make sure that Windows Defender is running and that the real-time protection is enabled. You can check this by going to the Windows Security app or by running the command "MpCmdRun.exe -getversion"
- Check the updates: Make sure that the latest updates for Windows Defender are installed on your system. You can check for updates by running the command "MpCmdRun.exe -SignatureUpdate"
- Check the event viewer: Check the event viewer for any error messages related to the MpCmdRun.exe or Windows Defender that might provide more information on the cause of the issue.
If the above steps do not help you resolve the issue, you can try running the MpCmdRun.exe as a different user that has the necessary permissions and see if that resolves the issue. If the issue persists, it may be best to seek assistance from Microsoft support.
If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.