Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there more shortcuts like %appdata%?

I am trying to manage some data with C# porgram. Data is usually in Desktop or similar basic Windows location. Right now I type full path to specific folders, but I know that there are shortcuts like %ProgramFiles(x86)%, %appdata%.

Are there more of them? Can I use them in my program?

like image 634
MrJW Avatar asked Oct 07 '16 12:10

MrJW


1 Answers

There are plenty of system variables. Yes you can use them in your program.

To name a few:

Environment Variable    Path
%ALLUSERSPROFILE%   C:\ProgramData
%APPDATA%   C:\Users\{username}\AppData\Roaming
%COMMONPROGRAMFILES%    C:\Program Files\Common Files
%COMMONPROGRAMFILES(x86)%   C:\Program Files (x86)\Common Files
%COMSPEC%   C:\Windows\System32\cmd.exe
%HOMEDRIVE% C:
%HOMEPATH%  C:\Users\{username}
%LOCALAPPDATA%  C:\Users\{username}\AppData\Local
%PROGRAMDATA%   C:\ProgramData
%PROGRAMFILES%  C:\Program Files
%PROGRAMFILES(X86)% C:\Program Files (x86) (only in 64-bit version)
%PUBLIC%    C:\Users\Public
%SystemDrive%   C:
%SystemRoot%    C:\Windows
%TEMP% and %TMP%    C:\Users\{username}\AppData\Local\Temp
%USERPROFILE%   C:\Users\{username}
%WINDIR%    C:\Windows
like image 175
user2924019 Avatar answered Sep 28 '22 18:09

user2924019