Windows Command line

All kinds of command line tips and tricks

 

Search for writables files

http://justinsboringpage.blogspot.dk/2009/01/finding-writable-files-in-directory-in.html

Find which files in a directory are writable, use this dos command …

dir /a-r-d /s /b

/a is to search for attributes. In this case r is read only and d is directory. The minus signs negate those attributes. So we’re looking for writable files only. 

/s means recurse subdirectories

/b means bare format. Path and filename only.

Eg. search for all writable *.cs files in all subfolders and save to file:

C:\SourceSafe_LDV24\DataLevering\DataLeveringSQL>dir *.cs /a-r-d /s /b > writablefiles.txt

This can be useful if you are unlucky enough to work with Visual SourceSafe!