Monday, February 28, 2011

Legacy SourceSafe: How To Find Checked Out Files By User

If you still happen to be using Microsoft SourceSafe, stop and use Team Foundation Server ;) No all kidding aside, you may still use VSS or be ready to migrate to a newer platform like TFS and need to do some cleanup or preparation first. One common task is to find out all of the files checked out by an individual user.

You can accomplish this using the SS.exe tool that is installed alongside SourceSafe. It is located in the following directory:

C:\Program Files\Microsoft Visual Studio\VSS\win32

To open the tool, open a command prompt (I used Visual Studio .NET's Command Line Tool) and change directories to the location of SS.exe like below (if your files do truly exist on the C:\ drive):

CD C:\Program Files\Microsoft Visual Studio\VSS\win32

Now you are ready to issue commands to the SS.exe tool. You might wonder why you can’t just open it directly, but if you try only the screen flashes and the VSS help for the tool is opened. You must run commands against the tool in an existing command window session.

The command to fins all checked out files in VSS by user is as follows:

ss.exe Status $/ -R -U <username>

The 'Status' command extracts checked out file information, the '-R' switch dictates the search will be recursive to subprojects, and the "-U" switch specifies a user name. So if we had a username "jsmith" we could update the command to be more specific as follows:

ss.exe Status $/ -R -U jsmith

Upon pressing enter, please be patient. The search process can take quite some time, especially if there are a lot of files in VSS. The result set will show the project and files checked out by the user specified. If needed, you can copy all of the results into notepad, by right-clicking on the window title, and selecting Edit -> Select All ...and then Edit -> Copy.

For more detailed information on the SS.exe command tool and its Command Options, please check out the links below:

MSDN: Command Options

MSDN: SS Utility

No comments:

Post a Comment