In TFS, either using Visual Studio 2019 or the web interface, what should I do to locate a file by name or part of a name or extension? I have a large repository and I need to find a specific file, but it is not practicable to open each subfolder to try to find it visually.
-
Which version of TFS are you using? There is a builtin search starting in TFS 2018 where you can search your whole TFS from the search bar on the TFS welcome screen. – Etienne Oct 28 '19 at 12:30
-
Team Foundation Server 2013 – user1443098 Oct 28 '19 at 13:32
-
ah. Like I said the search in product started in 2018. There is no *easy* way to do this, I would look at the solutions below until you can upgrade. – Etienne Oct 31 '19 at 12:27
2 Answers
Updated
Since you are using TFS2013 and VS 2019 to find file without checking out the code locally.
- Option1: Choose to install VS 2015 with TFS Power Tools and then use Find > Find by Wildcard feature
- Option2: Upgrade your TFS server to version 2017 and above. There is a search sever/feature. Through the Code Search to search across all of your projects, find specific types of code, and easily drill down or widen your search
Workaround(not work with OP): use a wildcard directory path with TF DIR as follows:
tf dir /folders $/<PROJECT_NAME>/*Prod /recursive /collection: http://<HOST_NAME>/tfs/<COLLECTION_NAME>
Note: The command does not support wildcarding the PROJECT_NAME in the command above, if you try wildcarding the PROJECT_NAME the command will return the following response:
Sample and result for reference:
Without creds cached on your local machine. If you need to specify creds by adding the following argument: /login:<DOMAIN\USERNAME>,<PASSWORD>
Besides, if you already pull/map the repository in local machine with all files. You could also use a local tool or system build-in search feature to search the files.

- 49,478
- 5
- 35
- 62
-
I get `TF400324: Azure DevOps services are not available from server https://
/tfs/td-tbsm. Technical information (for administrator): Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xx.xx.xx:443 Command canceled by the user.` – user1443098 Oct 24 '19 at 15:55 -
@user1443098 This error may related to cache , please clear TFS cache and try again, also run the command line with admin mode. For details please take a look at this link: https://stackoverflow.com/a/48618076/5391065 If still not work, you could also go through and check if other solution work. – PatrickLu-MSFT Oct 25 '19 at 10:06
-
Hi @user1443098 any update on this issue? Did you get a chance to implement the solution that I suggested? Were you able to resolve? – PatrickLu-MSFT Oct 30 '19 at 01:27
-
I have three TFS versions in localappdata: 6.0, 7.0, 8.0. not sure which one is pertinent (all?) But the instructions seem to imply accessing locally. what I want is to access the server without checking out the code locally. – user1443098 Oct 30 '19 at 15:49
-
1
-
Hi @user1443098 It works properly in my side. Another place to check is Control Panel\Credential Manager and remove all cached TFS login info. Run the cmd under Administrator mode. Besides, if your network is behind a proxy, temporarily remove proxy and disable firewall and check it this do the trick. – PatrickLu-MSFT Oct 31 '19 at 09:00
-
@user1443098 Since you are using TFS2013 with VS 2019 , instead of using that `tf.exe` command, there is not any better way to search file without checking out the code locally. Otherwise, you have to either install VS 2017 and use `Find > Find by Wildcard ` feature or upgrade your TFS server to version 2017 and above. There is a search sever/feature. Details please refer this official link:https://learn.microsoft.com/en-us/azure/devops/project/search/overview?view=azure-devops – PatrickLu-MSFT Oct 31 '19 at 09:06
-
OK, well since I'm blocked from admin access, and can't upgrade TFS (we're actually deprecating it in favor of git), I'll go the check out route. – user1443098 Oct 31 '19 at 13:23
-
it you add the caveat that the first method won't work with TFS 2013 and VS 2019, I'll mark it as an answer. – user1443098 Nov 01 '19 at 15:18
-
Hi @user1443098 Thanks for your quickly response. Have updated and summarized my reply with two option and workaround. Also noted that workaround is not working with you. (Even my own guess is that your Authentications not work properly with tf.exe command or your sever url/IP address are blocked ) Please kindly check the updates. Hope it's clearly and helpful. – PatrickLu-MSFT Nov 04 '19 at 07:28
If you have Visual Studio 2015 or below, you will need to install TFS Power Tools for the corresponding VS version, and then you can open Source Control Explorer in Visual Studio, right-click on a root folder and select Find > Find by Wildcard from the context menu: . You can then enter full or partial file name, and as long as it's under TFS source control, it will find it.

- 192
- 4
-
Unfortunately, Microsoft dropped PowerTools starting VS 2017. The workaround would be to use command-line tool tf.exe. Open Visual Studio 2019 Command Prompt and run tf vc dir $/Project/Dir/wildcard*.c* /recursive /collection:
– Eugene B. Oct 23 '19 at 20:20 -
Well, yes, though I really don't want to download gigabytes of source code just to find one file. Pity this can't be done in the web interface. that would be so nice 'n easy! – user1443098 Oct 24 '19 at 13:44
-
If you are using TFS source control, you do not need to even have a workspace or download all the items. The syntax I mentioned, works without having items downloaded. If, however, you have Git, that's a different story :-) – Eugene B. Oct 24 '19 at 13:47
-
There is also similar conversation on StackOverflow a few years ago :-), just found it: https://stackoverflow.com/questions/13251695/tfs-search-for-a-file-by-name-in-source-control?noredirect=1&lq=1 – Eugene B. Oct 24 '19 at 13:48