Delete all writeable files from a folder heirarchy - Handy for Perforce users on Windows

Despite being a huge Mac fanboy (see the keyboard & mouse combo in the header pic), I use a PC running Windows XP at work. As such, I'm pretty used to bash-esque shells, and am continually frustrated by the Windows command-line being just that little bit different.

My build tree has been broken for a couple of days, and in the hope of saving it, I wanted to get rid of all the files that weren't part of version control. We use Perforce for version control, which handily makes all the files it manages read-only (requiring you to explicitly check them out to work on them). So all I needed to to was delete all the writable files in my source tree.

If I were on my Mac or a Linux machine, I might do some complex series of piped commands in a crazily complex script...before discovering a specific command that could do what I wanted. Being on Windows, I had to read up on the syntax for the del command.

Hooray! All I needed to do was:

del /Q /S /A-r *

Bingo!

This is probably quite obvious to any Windows peeps who use the command-line a lot. But heck, if I write about it here, I might remember the command next time.