Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

Is it Safe to Delete This File?

The one thing you need to do before you hit delete.

Deleting Data

When running out of disk space, considering what you can delete makes sense. I'll look at the steps to determine whether a file, such as a .dat file, may be important.
The Best of Ask Leo!
Question: My C: and D: drives have many gigabytes of .DAT files under “Documents and Settings”. I’m trying to free up space on the C: drive. Is it safe to delete these files? I really don’t know what they are, how they got there, or why they occupy so much space on my computer!

I don’t know.

Honestly, I have no idea what they are, how they got there, or why they occupy so much space. That’s the problem with “.dat” files — there’s no way to know what they are without more information.

But I do have ideas on how to determine if deleting them is ok, and ways to do it safely — and these ideas apply to any file.

Become a Patron of Ask Leo! and go ad-free!

TL;DR:

Summary: Deleting a file safely

  • Back up the file or files.
  • Delete (or rename) them.
  • Use your computer to see if there are related failures.
  • Reboot, watching for related failures.
  • Use your computer, and keep watching for problems related to the files’ removal.
  • Restore from your backup if there turn out to be issues.

.DAT?

There’s no way to know what a “.dat” file is without knowing what program created it. The file extension “.dat” is a generic extension, often used to represent nothing more specific than “data”. As a result, it is used by many, many applications. There’s no way to know what the file contains or what to do with it without first knowing which application created it.

So, how do you determine if a file — any file — matters?

Well, my first suggestion is the most important one.

Back up first

Before you do anything, back up the files. Copy them to thumb drives, copy them to another computer, take an image backup of your machine, if you like; just make sure there’s a copy somewhere else in case you really did need that file after all.

You may find the file is an important part of some application you rely on daily, or worse, an application you only use once a month or so. If you simply delete the file, it’s gone without reasonable hope of recovery. If you’ve backed it up somehow, you’ll not only be able to remove it from your system, but put it back if you discover removing it was a mistake.

Safe delete

After backing up, my next steps are fairly simple.

  1. Rename the file or files.
  2. Use your computer for a while.
  3. Reboot.
  4. Use your computer for a while longer.

If an error occurs related to the missing original file name, you now know what the file was about, and can decide what to do based on the error you get. If you discover no errors, you’re ready to move to the next step.

  1. Delete the file or files.
  2. Use your computer for a while.
  3. Reboot.
  4. Use your computer for a while longer.

Do a variety of tasks on your computer to exercise some of the applications you have on the machine. Once again, if an error occurs related to the now-missing file, you now know what the file was about, and can decide appropriately based on the error you get. If you discover no errors, you’re done. Sort of.

  1. Remember you deleted the file and where you put the backup.

Our simple tests above may not have fired up the application or duplicated the scenario requiring the file. You may not find out until some lengthy time down the road that the file you deleted some months ago turned out to be part of an application you haven’t touched in ages. Hence, again, the importance of the backup.

If you can’t delete

If you can’t delete or rename the file, it’s possible that’s because the file is in use.

That’s great! It tells you that the file matters. If you like, you can then use a tool such as Process Explorer to figure out what program’s using it. Once you figure that out, you can once again decide the right course of action, based on knowing which application is accessing the file.

Do this

Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.

I'll see you there!

Podcast audio

Play

25 comments on “Is it Safe to Delete This File?”

  1. Is it safe to delete every single .log file on my computer? I noticed it takes up a lot of space, and quite honestly I do not want logs of everything going on in my computer. So, is it safe to do or will it hurt my computer somehow?

    Reply
  2. —–BEGIN PGP SIGNED MESSAGE—–
    Hash: SHA1

    If you’re not sure, just follow the instructions in the
    article. :-)

    Leo

    —–BEGIN PGP SIGNATURE—–
    Version: GnuPG v1.4.7 (MingW32)

    iD8DBQFILdGACMEe9B/8oqERAmvJAJ4wxp3FZIDREUH3BfU4HpOb/9rbkwCfe4Nq
    g0MKKW2VvOMPER7SiRudws0=
    =hGVu
    —–END PGP SIGNATURE—–

    Reply
  3. I received a low storage message which sugggested deleting unnecessary files. My hard drive is a 30+GB and thought it unusual to be low so I check and sure enough, I’m out of room. Question is can I safely move files from the C drive to a secondary hard drive, which files are ok to move, and how do I go about moving them to free room on my C drive?

    I would first try to figure out what’s using up all that disk space. This article would be a start: Where’s my disk space going?

    – Leo
    11-Oct-2008
    Reply
  4. I’m not suggesting this is a particularly sophisticated solution but if you make a diary note of the date and delete files to the Recycle bin and then, umpteen weeks or months later, if you find you’ve accidentally deleted something you need, you can go to the Bin and restore it.

    Ask-Leo Rocks!

    Reply
  5. I wanted to know if you get rid of the “back up copies” of your system .dat and the user.dat files?….I am not interested in backing up the files that have already been backed up…I would appreciate the answer to this question..thanks
    Fran Perry Windows XP

    Not sure which backups you’re referring to. (But in general: better too many than too few.)

    Leo
    02-Sep-2010

    Reply
    • The files system.dat and user.dat are part of the Windows registry. You can’t, and really don’t want to, delete them.
      It’s safe to delete the backup copies, it’s just that you won’t be able to revert the changes made to the registry after those backup where made. If you have several, keep only the latest if it’s less than a month old. Those older than a month are obsolete.

      Reply
  6. Instead of copying and deleting those files, I usually move them to another drive. The end result is identical, but doing it this way assures that you’ve backed up the file before deleting. If you copy and delete them in two steps, you may accidentally delete one you thought you backed up.

    Reply
  7. Other suggestions for exploring what a DAT file is: Look at the root folder where it’s located. A DAT file doesn’t typically exist directly under “Documents and Settings” or the “Users” folder under Windows 7 and above. It exists under a folder tree, typically under a folder with an application’s name, so at least you find what application it’s associated with. Next, look at the file’s time/date stamp. If it’s stamped seconds after you booted your machine, it may be related to the OS, otherwise if its two years old, it’s probably safe to delete it (after backing it up). A trick that may give you an idea about a DAT file’s association is to get a copy of the file, change the copy file name’s extension to .txt, and open it with Notepad. Sometimes there will be readable text at the top of the file associating it with some application (of course, the rest of the file may look like gibberish). Finally, the obvious: Google the file name!

    Reply
    • Instead of changing the extension to .txt, it would be safer to add an extension after the .dat of .log. If you just change the extension, you might forget what you changed it from. data.dat.xxx or data.dat.deleted would let you know the original name, extension, and original location.

      Reply
  8. Although extremely unlikely (because Windows isn’t known for using “*.DAT” files in system-critical applications — or even, to the best of my recollection, using “*.DAT” files very much at all), before deleting ANY suspect file whatever, you should ALWAYS make an image backup of your entire system — just in case* deleting the file renders your system unbootable.

    —–
    *Or, as my family would put it, “Justin Cayce deleting the file renders your system unbootable.” (To which someone always replies, “Oh, him again.”) :)

    Reply
    • Alain wrote:

      “…system.dat and user.dat…”

      Ooooo! I completely forgot about those!!!

      Absolutely, you do NOT want to tamper with those in any way, and you most certainly do NOT want to delete either of them! Those two files really ARE “System Critical,” and deleting either one is among the fastest ways I know to render your system unbootable.

      So, I must compketely unsay my last response: If you’re planning on deleting a “*.DAT” file, be careful… very, very, careful! Yeesh!

      Reply
      • On a positive note, it’s not possible to delete those files while Windows is running. Windows doesn’t allow you to delete files in use. And if you are backing up like you should, you can always restore Windows to a bootable state.

        Reply
  9. Here’s my unsophisticated methodology for freeing up space:
    1. Delete what I KNOW I can get rid of.
    2. If I don’t know what it is, I don’t touch it.
    3. Use something like CCleaner to get rid of junk.
    4. If all else fails, buy a new laptop with lots more space. :-)

    Reply
  10. I am puzzled by the timing of responses you have to your weekly newsletters. For example the current one dealing with how to safely delete files whose nature you do not know. You apparently published this recently, like within the last few days, yet there are responses to it made on February 9, 2007. There is another response written by a reader made on October 9, 2018, and responded to by Mark Jacobs on April 5, 2021. Are we communicating with people still living in the past? Are they communicating with people (us) living in the future?

    Reply
    • The newsletter (the email you get each week) is new each week. The articles it points to (like this one) are a mix of newly written material or material that’s been updated since it was originally published. You can see “This is an update to an article originally posted November 16, 2006” in the information just above the comments on this page. Smile

      No time travel required.

      Reply
  11. I change the name in a way that will tell me what it used to be by appending “was” to the front and I sometimes add the date I did it to the name. For example, sample.dat becomes wassample.dat or was 4-13-21 sample.dat. This leaves it in the place it belongs and it is easily identifiable and recoverable.

    Reply
  12. To free space, first focus on what will make the most difference (not necessarily .dat files). Sort all your files in the order of size and see if some of the heavy hitters are eligible for deletion. You may need a good file handling tool other than Windows (because Windows may not show you all your files without you jumping through hoops). Typically the biggest files are picture and movie files, followed by the archives of whatever anti-malware you have, email utility file(s) (such as .PST in Outlook), Windows Update garbage, and installed games. If you are in the habit of putting your Windows into one of the several suspension modes (sleep, hibernation, fast startup) be aware that these create large files to store your running configuration. Registry restoration files can also be big and pile up.

    After you delete files, remember to empty the recycle bin so that you can reclaim the space as free on your drive.

    If you should get a new computer think ahead about minimizing the chances of running out of space on the C:\ drive: Create a second partition (D), separate from C where Windows is installed. Size the C drive to at least 200GB and the remainder can be the D partition. Think of this new D drive as the “Data” partition. Install and store everything on D. If D should run out of space you’ll know that anything on D is what you installed and deleting it won’t crash the OS.

    Side story: Leo is probably going to say that if you have C and D drives then your image backup strategy is going to be more difficult. Oh well, you can’t have it all. If you’re serious about backup and recovery then you’ll deal with it even if you have 5 partitions.

    Reply
  13. Consider this my opinion, and not facts. Any software that puts useful data in arbitrary places where a user can trounce upon it is something that was cobbled together by careless programmers. I have no use for such software, and if deleting the data breaks it, good riddance! As for the computer becoming unbootable as a result of deleting data of arbitrary and unknown nature, I find it unlikely. The Windows 10 developers would not put system-crucial data in such weird and arbitrary places. So go ahead and delete them.

    Reply
    • Having been one I have a little more sympathy for the software engineers. It’s easy to point fingers, but you’re not aware of the constraints, pressures, and demands placed upon them. That useful data might be delete-able is, in my opinion, not just inevitable, but is by itself not a reflection on the folks putting it together. These are things that are amazingly easy to overlook in a rush to a deadline. Yes, you can argue then the deadline was wrong, or the product scope too large, but software must ship, and each version needs to be better than the previous, or that software will die.

      Similarly, Windows 10 has been in continual development for over 25 years. That there might be an accidental omission in security is not only not surprising, we hear about it all the time.

      Finally, you’d be surprised what lengths people will go through to delete a file they don’t understand. Seriously … I’ve seen stories.

      Reply
    • I’ve been a software engineer also, for a long time, in many capacities. Sorry, but it’s not about “constraints, pressures, and demands”. In the case of Windows OS the concept of application “installation” is a fiasco. It was the original bad design that allowed a bizarre, complex and convoluted scheme to copy pieces of an application (including the OS) in countless folders, and later in hundreds of locations in the Registry. Of course, application developers abused this scheme because they wanted a permanent foothold on your machine. In the Windows OS applications use pieces of the OS and the OS uses pieces of various applications, creating an interdependent mess. If the Windows OS gets bloated over time or crashes because of an installation, uninstall or an update this “design” is the primary reason. There are better ways and the Linux/Unix world used it and still uses it: copy everything associated with an application into one folder, separate from the OS. If the application needs interfaces with the OS, those are well defined and well-constrained to a few places within the OS folders. Of course, I wouldn’t blame any individual software developer for this mess.

      Reply
      • Addendum: A couple of related things worth noting. One is that the Windows installation scheme has given rise to a lucrative industry in cleaners and uninstallers. The other is that malware designers have literally thousands of places to hide they files and hundreds of ways to execute (run) their applications.

        Reply

Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.