What is "%AppData%"?

20

13

I just recently followed some instructions to reset GitHub for Windows by deleting two folders in the explorer found under %AppData% and %LocalAppData% respectively.

I've seen these paths before but never understood them, and searching for them didn't yield the information I wanted to find.

What does the percent sign mean in filepaths on Windows (as opposed to navigating via C:\Users\etc), and what are the folders AppData and LocalAppData?

temporary_user_name

Posted 2013-08-16T22:07:06.113

Reputation: 915

How-To Geek: What Is the AppData Folder in Windows?

– Stevoisiak – 2017-10-25T18:05:11.247

Answers

15

%WORD% is how cmd.exe (and Windows in general) does variables. So %AppData% is the variable name for the application data directory.

C:\Users\USERNAME>echo The value of ^%AppData^% is %AppData%
The value of %AppData% is C:\Users\USERNAME\AppData\Roaming

Etan Reisner

Posted 2013-08-16T22:07:06.113

Reputation: 1 848

Wow, they don't even use \ for escaping? Why does Windows command line have to be different in every conceivable way? – temporary_user_name – 2016-04-27T16:18:22.533

5@Aerovistae How could it reliably use \ for escaping when \ is the path separator? – Etan Reisner – 2016-04-27T17:07:52.250

Also, Windows is old. Using \\ to escape characters wasn't as much of a standard back then. – Yay295 – 2018-08-27T20:51:46.697

7

More specifically, they are environment variables, accessible via cmd.exe's set command. Each process either has an environment consisting of variables or inherits one from a parent process. Good information here: http://en.wikipedia.org/wiki/Environment_variable

– LawrenceC – 2013-08-16T22:19:35.403

7

%AppData% is a hidden folder in Windows 7. It is to protect user data and settings from any unwanted change or deletion. It contains many important data such as: program settings, IE cookies, IE browsing history, temporary files created by applications, etc.

%LocalAppData% this is %USERPROFILE%\AppData\Local. For example: C:\Users\<Username>\AppData\Local.

See also (KNOWNFOLDERID) from MSDN.

stderr

Posted 2013-08-16T22:07:06.113

Reputation: 9 300

5

Like the others have said, the % symbols around %AppData% indicate it is an environmental variable.

These two are predefined paths that vary by Windows edition.

From Vista onward, %AppData% points to %UserProfile%/AppData/Roaming (I think you can guess what %UserProfile% is, or just test it out for your self in Explorer). This folder contains user specific, program related data, or even the programs themselves.

The items in here should roam with the user to different machines. How profiles roam was more apparent to users in a Domain environment who used the same credentials on different company machines. But now that Windows 8 utilizes the cloud and a Microsoft Account for login, this feature should become more apparent to users with multiple machines.

I'm not sure this folder is always used correctly. Google Chrome, for example, will store gigabytes of data in it. Other programs might use it to store items like MyLayoutSettings.cfg, to have some consistency among settings across to different machines. I think this is a more "correct" way to use the folder.

%LocalAppData% (%UserProfile%/AppData/Local) is used for user-specific items that should not roam with the user, either because they only pertain to that particular machine, or because they are too large. For a good example of how this location can be used, take a look at %LocalAppData%/Temp.

Louis

Posted 2013-08-16T22:07:06.113

Reputation: 18 859

2

The AppData\Local and AppData\Roaming locations are the preferred locations for applications to store data which is not required to be exposed to the user. In a domain environment the Roaming folder is used to copy the user's environment as they log on to different computers.

You can find a description in this Microsoft document

David Marshall

Posted 2013-08-16T22:07:06.113

Reputation: 6 698

1

As other answers have mentioned, AppData is a hidden Windows folder typically used by programs to store data and settings. While this is true, it's not the folder's only use.

While traditionally most Windows programs install to Program Files, some will install to %AppData% instead. This includes apps like Gitter Discord, f.lux, and yes, GitHub Desktop for Windows.

This is usually because, unlike Program Files, an app can install to AppData without administrator privileges, since the folder is not shared among multiple users.

Stevoisiak

Posted 2013-08-16T22:07:06.113

Reputation: 8 152

1

Just enter %AppData% or %LocalAppData% in the address bar of File Explorer and it will take you to the folders.

As others explained, these are Environmental Variables which can be listed at the Windows Command Prompt using the SET command.

Gordon Bell

Posted 2013-08-16T22:07:06.113

Reputation: 243