Menu

  • Blog
  • Who the Heck?
  • A Novel in 2010
  • YouTube
  • Mail me

Navigation

  • Create content

User login

  • Create new account
  • Request new password

Friendly Types

  • The Naked Speaker
  • Andy Millar
  • Living to Eat!
  • MemeMe
  • Benjamin Gray
  • Charlie Richardson

Sites I Likes

  • xkcd
  • Boing Boing
  • Bloglines
  • Cute Overload! :)
  • Explosm!
  • I Can Has Cheezburger
  • www.AppGiveaway.com
Home » Blogs » Tom's blog

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

Submitted by Tom on Wed, 06/03/2009 - 13:54
  • coding
  • command-line
  • Perforce
  • 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.

Bookmark/Search this post with:
  • Delicious
  • Digg
  • StumbleUpon
  • Reddit
  • Facebook
  • Technorati
»
  • Tom's blog
  • Add new comment

Subscribely Goodness

 Subscribe through FeedBurner

Subscribe in Bloglines Add to Google Reader or Homepage 

Add to Technorati Favorites

My Projecty Things

Twitter Updates

    follow me on Twitter