Awesometoast.com

The multipurpose website of Aaron W. Herd

Delete all hidden OSX junk files in Windows (Like .DS_STORE)

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 ↓

#1 by Bob on 11.28.11 at 9:59 pm

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 ._*

?

#2 by Aaron on 11.29.11 at 10:36 am

It sure does! I just tested it.

#3 by crowdyR on 02.27.12 at 8:41 pm

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.

#4 by Michelle on 05.17.12 at 1:37 am

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.

#5 by Michelle on 05.17.12 at 1:37 am

…. Oh, but the “del /s /q /f /a:h ._*” command worked – Thanx :)

#6 by Andrew M on 05.21.12 at 6:51 pm

Thank you very much for this!

#7 by uau on 05.28.12 at 5:16 am

use:
del /s /q /f .DS_Store
and it will work.

#8 by Nathaniel Hirschler on 09.30.12 at 11:52 pm

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.

#9 by Aaron on 10.01.12 at 9:31 am

19,617 — That’s definitely a lot. Very glad I could help!

#10 by peter on 11.04.12 at 9:31 am

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.

#11 by Paul on 11.17.12 at 2:22 am

Nice one!

#12 by Johnny on 12.05.12 at 1:00 am

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.

#13 by Aaron on 12.05.12 at 10:56 am

Ah! Very good to know. I’ve updated the post accordingly. Thanks!

#14 by gmeben on 01.10.13 at 1:15 pm

I’m running Windows 7 and the comment left by @uau worked for me:
del /s /q /f .DS_Store

#15 by Jeremy on 03.18.13 at 9:13 am

Thanks this worked great

#16 by VW Golf Mk7 – SD Cards and Album Art « Haydn's Blog on 06.12.13 at 10:20 am

[...] 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 [...]

#17 by Tim on 06.19.13 at 11:49 am

Thanks for this. Was driving me crazy having all these random useless files showing up.

#18 by HCN on 06.19.13 at 9:13 pm

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