66

I am trying to setup my TFS2010 Build and I want to access the files that are downloaded via the "Version control path to custom assemblies".

From what I can tell those files are downloaded to:

C:\User\<Build User>\AppData\Local\BuildAgent\<Built Agent Number>

I can directly access that folder via the above path, but it would be nice if there was an environment variable (or something I can use in the build) to access that folder indirectly.

Or... Is there a better way to get at these files? (I am putting a version file in there to be downloaded every time the build is run).

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Vaccano
  • 78,325
  • 149
  • 468
  • 850

1 Answers1

133

You can use %LOCALAPPDATA% environment variable. It expands to

RootDrive:\User\LoggedInUser\AppData\Local


Example: %LOCALAPPDATA%\BuildAgent


Note that %APPDATA% will expand to

RootDrive:\User\LoggedInUser\AppData\Roaming

informatik01
  • 16,038
  • 10
  • 74
  • 104
swatkat
  • 4,785
  • 1
  • 23
  • 17
  • Deriving from %appdata% environment variable, I tried to guess it as %appdatalocal% assuming local is a sub-directory inside `appdata` directory. I gave up thinking such an environment variable might not exist. Thanks for the answer. +1 – RBT Feb 17 '17 at 10:59
  • 1
    For WINDOWS 10: https://learn.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables – OLIVIERS Oct 26 '21 at 19:53