How To Delete hdmp files

Hello Friends, in this article we will learn how to delete hdmp files. But before removing hdmp files we should know what is hdmp file. Actually, .hdmp is the uncompressed version of an error dump. And the .mdmp file is the compressed version. This is for your knowledge that when a program is crashed then a user dump file creates which can be used for analyze purposes. This is safe to move or delete these dump files. Now, the creation of dump files depends upon how soon application crashes. 

Steps To Remove hdmp file

If you want to delete hdmp/mdmp files from machines then firstly search it. These files can be found in below locations:

C:\Users\User_login_name\AppData\Local\Temp\*.hdmp

C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_*.* (Inside this folder you will see files with extentions .hdmp and .mdmp.

OR

C:\WINDOWS\PCHEALTH\ERRORREP\UserDumps (Inside it)

Go into these locations and delete these files.

This is manual task which is tedious one if a number of workstations are with you. So then we come to Group Policy. GPO is a good solution to get it done in one shot. 

a) Create Batch File

b) Create GPO and add batch file in Logon Script

a) Create batch file: Type the blow lines in notepad and save it with extention .bat. The extention “.bat” indicates that it’s a batch file containing some commands in it to execute.

——————————

echo batch file to remove file

cd “C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_*.*”
del “*.hdmp” /S /F /Q

cd “C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_*.*”
del “*.mdmp” /S /F /Q

cd “%temp%”
del “*.hdmp” /S /F /Q

cd “%temp%”
del “*.mdmp” /S /F /Q

echo completed


OR use below lines

echo batch file to remove file

cd “C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_*.*”
del “*.hdmp” /S /F /Q

cd “C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_*.*”
del “*.mdmp” /S /F /Q

cd “C:\Users”
del “*.hdmp” /S /F /Q

cd “C:\Users”
del “*.mdmp” /S /F /Q

echo completed

————————-

Put file extentions as per your requirement.

b) Create GPO and add batch file:

Create fresh GPO and go to below path:

User Configuration–> Windows Settings–> Sctipts (Logon/Logoff)

Once reached to this path then on right hand side double click on Logon and add this file.

 Now, go to user machine. run gpupdate /force command. Check and verify, files are gone.

Thanks.

Other Posts: