-3

Where do I go to find all of the Windows shortcuts, or easy-links, or whatever they are called?

I am talking about the ones like %appdata%. I want my program to put a shortcut directly on the desktop using one of these commands in my Java program that I will eventually convert to C#. Is there a list of these?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • Possible duplicate of [List all environment variables from command line?](http://stackoverflow.com/questions/5327495/list-all-environment-variables-from-command-line) – glw Mar 10 '17 at 19:13
  • Also "on the desktop"? Who's? Public, default, or users? – Austin T French Mar 10 '17 at 19:40

2 Answers2

0

Windows Vista and Later

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
Community
  • 1
  • 1
Das Nuk
  • 46
  • 8
0

It seems to me that you are trying to refer to what Windows calls SpecialFolderConstants (or sometimes referred to Common Folders). However, not all of these are available as environment variables (as you mentioned %APPDATA%).

See these links to get further information

To get a list of your environment variables and check which common folders are defined as variables you can use PowerShell and run

cd env:
dir

You could place something on the user's desktop by starting with something like this:

var path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

However, for creating desktop shortcuts, your question might already be answered by Create shortcut on desktop C# .

Community
  • 1
  • 1
Ronald Rink 'd-fens'
  • 1,289
  • 1
  • 10
  • 27