Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get %LocalAppData% in c#?

Tags:

c#

.net

How do I get %LocalAppData% in C#?

like image 552
Dee Avatar asked Dec 30 '09 13:12

Dee


People also ask

How do I get Localappdata?

To open the AppData folder on Windows 10, 8 & 7: Open File Explorer/Windows Explorer. Type %AppData% into the address bar and hit enter. Navigate to the required folder (Roaming or Local)

What is the Localappdata folder?

The AppData folder includes application settings, files, and data unique to the applications on your Windows PC. The folder is hidden by default in Windows File Explorer and has three hidden sub-folders: Local, LocalLow, and Roaming. You won't use this folder very often, but this is where your important files reside.

How do I get to AppData in command prompt?

Run a command shell (start/Run, then "cmd") and type "set". This will list all the environmental variables available. Having said that, USERPROFILE is perfectly valid. There's also APPDATA and LOCALAPPDATA.


1 Answers

If you would like to use an enumeration, try the following:

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) 

Using this technique, you can also find all other Window's file paths (i.e Program Files, My Documents, etc).

like image 83
Blake Blackwell Avatar answered Sep 21 '22 21:09

Blake Blackwell