Shmulik Primes

A Programmers C#\.NET Blog

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Israeli .NET bloggers

Deep .NET

Subscriptions

Post Categories



Monday, May 31, 2004 - Posts

Productivity tip #1: Removing read only attribute from files (files binded to visual source safe)

 

When I work on a project that is bounded to Visual Source Safe, I sometimes want to edit a file locally, i.e. without checking out the change. The visual studio source safe addin monitors which files I can work on according to their attributes. If a file has the read only attribute, it cannot be worked on without checking out the file, or removing the attribute.

This can be done manually from outside of the Visual Studio.NET or from within, but this takes a few extra clicks.

This can be automated as a menu command or toolbar button by following these steps:

(To create menu command)

1. Click on: Tools -> External Tools...

2. Click on Add button

3. In the Title textbox enter: Remove Read Only

4. In the Command textbox enter: attrib.exe

5. In the Title textbox enter: -R $(ItemPath)""                 

No, "" is not a mistake, it seems like a bug in the IDE.

6. Check Close on Exit checkbox , and uncheck Use Output Window and Prompt for arguments.

7. Click the OK button

 

Now you can open a file and Click Tools -> Remove Read Only, and you can start using the file!

(To add command to toolbar:)

8. Click Tools -> Customize

9. Click New button

10. Name new toolbar. (for this example we will call it Custom Utilities)

11. Leaving the customize window open, Click Tools ->Remove Read Only, and drag it to the Custom Utilities Toolbar.

12. Add Custom Utilities to the other toolbars.

You can also add icons and choose other options by right-clicking the button while customize window is open.

13. Close customize window.

And that's it.

 

For those of you who might ask, I added the "" in instruction #5, because otherwise for some reason the IDE only added an opening " before the filename. (the final command can be seen by checking the Prompt for arguments button in the External Tools menu.)

 

posted Monday, May 31, 2004 10:01 PM by Shmulik Primes with 4 Comments




Powered by Dot Net Junkies, by Telligent Systems