Posts filed under 'CVS'

Delete CVS files

When you copy files from a CVS Repository you always get those CVS folders and files.
If you want to delete them and you don’t have access to the CVS Server than you can use this command line:
(updated, as code. If you copied it before 2007-01-16 the quotes weren’t correctly outputed)

for /f "tokens=*" %%i in ('dir /b/a/s CVS*') do @rmdir /q /s "%%i"

I’ve used Aral Balkan’s command from this link though it wasn’t working for me, because my CVS folders were read only and hidden. If your CVS folders aren’t hidden then I recommend you use Aral’s approach which is much faster.

Have fun and batch safely. I will not be held responsible if you delete any unwanted files. :-)
If you feel uncomfortable executing this command, try replacing @rmdir with echo this will give you a glimpse of what you’ll be deleting.
If you find yourself running the script quite often, then you can add the command to your windows explorer right-click context menu by creating a batch file.

Here’s the code for the batch file:

@echo off
echo Deleting CVS folders and files under: %1
REM Open Folder specified by parameter.
cd %1
REM Recursive delete command
for /f "tokens=*" %%i in ('dir /b/a/s CVS*') do @rmdir /q /s "%%i"
echo Done!

Open regedit and goto: My Computer\HKEY_CLASSES_ROOT\Folder\shell\
Create a new entry: “Delete CVS Files” and under that one, create a new key called: command
In Value add the path to the batch file created with %D %L at the end.
Here are some screen shots:

Right button click Context Menu.

Delete CVS File Context Menu

Regedit. Adding the folder right button click:

Regedit Folder Context Menu

*UPDATE*: Comments are closed for this post. I was getting too many spam.

11 comments January 13th, 2007


Calendar

December 2008
M T W T F S S
« May    
1234567
891011121314
15161718192021
22232425262728
293031  

Posts by Month

Posts by Category