How do I delete a file from my computer that won’t go away? Erase a file from your Windows Machine using the MS-DOS prompt!

I had this video file at work, a funny commericial, that every time I click on it, the windows explorer would crash. I could not delete this file for the life of me, but it was a large file and I wanted the space.
There is a way to get rid of the file using an MS-DOS prompt, so let’s run through those steps to see how.
Step 1: Open a prompt. On the Windows machine;
Click (Windows Key) + R
or
Click Start and choose “Run” on the lower right side. When you do, you will see a dialog box that looks like this;

Step 2: Type cmd. This will bring up an MS-DOS prompt.
It should put you in a certain directory name. In my case, my pops mine into this directory on my computer. C:\Documents and Settings\Jeff Rothe\>
Step 3: The directory I need to get to is on my C: drive, and is called “Music”. So from this directory path I need to type this in;
cd ../../
Basically what this is saying is Change Directory and each set of “../” means go up one directory. This should bring you up to the prompt that now says C:\>
Step 4: Now type this and afterwards hit enter;
cd music
This should now display C:\Music>
Let’s take a look for the file we are looking for. What we need to do is type this command and after hit enter;
dir
Very quickly all of the files you have in that directory will show up and go whizzing by your face. Make sure the file you are looking for is in the directory.
When you find the file, type this at your C:\Music> prompt and after hit enter;
erase /F /S /Q (filename)
So in my case, I am looking to delete a file called Commercial.wmv. I would type this in;
erase /F /S /Q Commerci*
The asterisk that I have added at the end of the filename prevents me from having to type out the whole file exactly as it appears. Basically was DOS does is searches through the directory for any files that start with Commerci and deletes them. This can be bad if you have more than one file named similarly, but in this case, I only had one file that started with Commerci, so the erase function deleted only the file I wanted to.
And for those of your who got this, but want to know what the /F /S /Q stand for, here you go;
/F = Force deleting of read-only files.
/S = Delete specified files from all subdirectories.
/Q = Quiet mode, do not ask if ok to delete
So, basically this means, delete all files with this name, from all subdirectories, and don’t ask me if it’s ok.
Final Step : To exit out of the the MS-DOS window, you can either close it, or you can type exit and that will close out the window as well.
Here are some similar arcade posts
- Linux Commands Defined
- The Task Manager (Shortcut = Ctrl+Shift+Esc)
- Where are the product pages for an Interchange located?
- Check Audio Drivers in Windows XP
- How do I save my action files? How do I bring / import my actions into a newer version of Photoshop?
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.











Comments
No comments yet.
Leave a comment