Search code examples
javac#windowsio

Windows shortcuts and links


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?


Solution

  • 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