About a month ago I wrote an article about why the command line was still useful. This morning I ran into a problem that once again proved the command line’s worth to me.
I was trying to delete an old website backup that was in the .zip format. When I tried to delete it, Windows gave me an error saying that the file could not be deleted because it was already in use. Since it was a zip file, there was no way it could be in use unless it was actually open. The file was not running so I couldn’t figure out why Windows wouldn’t allow me to delete it. I still don’t know why I was getting the error message but I was able to delete the file using the command line.
Go to Start > Programs > Accessories > Command Prompt. Navigate to the directory where the files is located using the cd command. When I open the command prompt it is already in the directory C:\Documents and Settings\myusername\. My file was two levels deeper so I did the following:
cd My Documents\kimwoodbridge
All I had to do now was type the delete command followed by the name of the file:
del mybackup.zip
Presto!! The file was gone.
The delete command can also be used to quickly delete the entire contents of a directory using wildcards. If I wanted to delete everything in the kimwoodbridge directory, I would navigate to that directory using the cd command and then type:
del *.*
This is telling the system to delete every filename with every type of file extension.
Do you ever use the command line? If so, what is your most common use? If not, do you not use it because you don’t need to or because you have never used it before?
photo credit: aldoaldoz
Ron Obvious says
Wow, thanks Kim!
I hadn’t known of this command before.
I have actually had situations in the past (similar to your example) when this would have come in handy. I’m making a note of it!
Ron Obviouss last blog post – Dr. Zaius, Dr. Zaius!
Kim Woodbridge says
Windows is annoying isn’t it? So illogical at times. There was no reason the file couldn’t be deleted and it’s great to know that there is another way to do it.
Thanks for stopping by again!
Scam says
That’s handy to know as I too often get the issue with windows saying something is open when I know full well that it isn’t.
My solution had always been to do a reboot and then I was able to delete it. This method is far simpler!
BTW, has your feedcounter been displaying a lower than expected number the last few days?
Scams last blog post – Breaking News : New WORK Virus Claims Millions Of Lives
Kim Woodbridge says
Actually I thought rebooting would correct the problem but in this particular instance it didn’t. And you’re right, using the command line to delete is a lot quicker.
Interesting that you found this to be a useful tip since according to you, women don’t know anything about computers ;-)
I don’t have a lot of RSS subscribers but until this weekend I was at about 55 so, yes, I’m about 20 lower. I think Feedburner needs some competition.
Scam says
I think there’s a problem with Feedburner – not only has it been slow to update but my count has dropped by about 30 over the last week, even though it was steadily increasing prior to that :/
Scams last blog post – Breaking News : New WORK Virus Claims Millions Of Lives
Vered says
Windows is WILDLY annoying.
Thanks for the tip!
Vereds last blog post – Aging: May I Please Get Off This Path Now?
Kim Woodbridge says
Hi Vered,
Windows can be frustrating when it isn’t behaving logically.
Scam says
Now you know how men feel about women!!!!