Some handy command script for TFS

Below mentioned scripts are utility scripts for managing TFS

Note : All text inside angular brackets are comments like : <COMMENTS>

Script #1: Get latest script
#cd C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE <path of
TF.exe>
#TF.exe get $/___TfsRootPath____/__BranchPath___ /recursive /force /
nonprompt > C:\GetLatestDailyFile.log <the path after greater then is
log path>

Script #2: Rebulid Solution script
#cd C:\WINNT\Microsoft.NET\Framework\v4.0.30319  <path of MSBuild.exe>
#MSBuild.exe “C:\\SolutionName\\BranchName\\FolderName\
\ProjectName.csproj” /t:rebuild /p:Configuration=Release /
p:DebugType=none > C:\RebuildSolution.log

Script #3: Publish Website script
#cd C:\WINNT\Microsoft.NET\Framework\v4.0.30319  <path of MSBuild.exe>
#MSbuild.exe “C:\\SolutionName\\BranchName\\FolderName\
\ProjectName.csproj” “/
t:ResolveReferences;_CopyWebApplication;publish” /
p:Configuration=Release /p:DebugType=none /p:OutDir=”\\DevServername\
\DevPath\\ProjectFolder\\bin” /pWebprojectOutputDir=”\\DevServername\
\DevPath\\ProjectFolder” >> C:\PublishWebSite.log

Script #4 Xcopy all the files and over write eixsting files (related
to publishing)
#xcopy “\\SourceServer\\SourceFolder\*” “\\DestinationServer\
\DestinationFolder\” /s /i /Y >> C:\XCopyFiles.log

Script #5 remove read only attribute from an folder
#cd\
#attrib -R C:\ProjectPath\BranchPath\Assemblies\*.* /s

Script #6 Search string from the comments of checked-in code (install
TFS power tool first)
#tfs history /server:http://tfs.mycompany.com:8080 “$/Team project/
Development” /noprompt /recursive | findstr refactoring

Happy programming!

Advertisement

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: