If you use OSX and Windows together often, you’re likely to end up with a bunch of hidden .DS_STORE files all over your Windows drives. You can easily search and destroy them all using this command:
(Open the command line first of course. You can do this by going to Start > Run, then typing “cmd” and mashing enter. Or just type “cmd” in the Windows 7 search box.)
del /s /q /f /a:h .DS_STORE
That will find every instance of this Mac resource file and delete it. Good times. I should note that this will only search inside the folder you’re in, as well as every folder below that. So, if you wanted to search and clean an entire drive, make sure you’re in the root folder. Get there with this:
cd \
Update:
Commenter Bob pointed out that you could also use this for other Mac junk files, like ._[filename] a like so:
del /s /q /f /a:h ._.*
Put both those commands into a batch file, and you’ve got instant cleanup! You could even have the .bat run at start time or something to automate the process. Thanks to commenter Johnny for an extra improvement!
Posted under: Fixing Stuff
18 comments ↓
Thanks for this.
So if I want to remove the ._filename garbage that OSX scatters after every file open as well, would it be:
del /s /q /f /a:h ._*
?
It sure does! I just tested it.
this command is not working on my PC. it says: “Could Not Find C:\.DS_Store”. But there are lot of .DS_Store file accessing through Mac to Windows.
Same here as mentioned by crowdyR – I get the same exact message (I am running a Windows 7 Ultimate OS). I know for a fact that I have at least 4 .DS_Store files as well.
…. Oh, but the “del /s /q /f /a:h ._*” command worked – Thanx
Thank you very much for this!
use:
del /s /q /f .DS_Store
and it will work.
This has helped keep my sanity. I was able to delete 19,617 ._* and .DS_STORE files! (I know this amount because when I backup, I exclude all ._ files, yet I was not able to delete them from the source side) Thank you so much.
19,617 — That’s definitely a lot. Very glad I could help!
I just tried it and it works! Thank you so much for this amazing tip! I heard some beeping sound though, twice. Wonder what that was.
Nice one!
don’t do ._* as what to be deleted! you end up deleting a bunch of pref files for google chrome. the files you want deleted have ._. so make sure you add an extra . to ._ THAT’S WHY you had 19k files deleted! you deleted stuff you might have needed.
stick to ._.* not ._* k good.
Ah! Very good to know. I’ve updated the post accordingly. Thanks!
I’m running Windows 7 and the comment left by @uau worked for me:
del /s /q /f .DS_Store
Thanks this worked great
[...] you're on Windows, you can delete the files at the Command Prompt using the command below (obviously you'll need to change to the relevant drive letter [...]
Thanks for this. Was driving me crazy having all these random useless files showing up.
We ran this cmd and have now lost every file. Did we do something wrong? The files don’t even show up in the “recycle bin”.
Leave a Comment