Environment variables
 
Environment variables can be used in most places where directories are used, for example in the button bar, start menu, or command line.
New: It's now possible to use partial environment variables. The syntax is the same as in the command processor cmd.exe:
%variablename:~5,7%  skips 5 characters and uses the following 7. Negative numbers count from the end of the environment variable.
 
Total Commander supports 5 types of environment variables:
1. The regular Windows environment variables, e.g. %TEMP% or %USERNAME%. You can see the environment variables defined on your system by selecting "Commands" - "Open command prompt window" and enter the set command.
The way to change the environment variables depends on your Windows version:
- In Win9x/ME, the variables are set in the file autoexec.bat, like that: set temp=c:\temp
- In Windows NT/2000/XP, go to the Control Panel - System, open the page Advanced, and click the Environment Variables... button.
- In Windows Vista/7/8/8.1/10/11, go to the Control Panel - System, in the left column click Advanced system settings, then open the page Advanced, and click the Environment Variables... button.
- In Windows 10, it's: Start -> Settings -> System -> About -> Advanced system settings (on the right), and after that just like in the previous item.
 
2. Internal Total Commander variables:
%COMMANDER_DRIVE% Drive on which Total Commander is installed
%COMMANDER_EXE% Total Commander file name including path
%COMMANDER_INI% Total Commander settings file including path
%COMMANDER_INSTANCE% Instance number, as shown in title bar (first instance = 1)
%COMMANDER_PATH% The Total Commander directory
%COMMANDER_SESSIONNAME% Contains the text admin when Total Commander was started with administrator rights, user otherwise
 
3. Special pseudo environment variable %$DATE%:
%$DATE% Inserts the 24 hour date and time in the form YYYYMMDDhhmmss
%$DATE:placeholders% Inserts the date in the form specified by placeholders. Same as in multi-rename tool:
Y Paste year in 4 digit form
y Paste year in 2 digit form
M Paste month, always 2 digit
D Paste day, always 2 digit
h Paste hours, always in 24 hour 2 digit format (0-23)
H Paste hours, always in 12 hour 2 digit format (1-12) 
i am/pm indicator in English
i1 same but 1 character a/p only
m Paste minutes, always in 2 digit format
s Paste seconds, always in 2 digit format
any non-alpha character like a dot or dash will be added directly
 
4. Pseudo environment variables from parameters of the function ShGetSpecialFolderLocation. Syntax: %$NAME%
The following variables are supported (at least the first character must be uppercase):
APPDATA,
DESKTOP,
PERSONAL,
PROGRAMS,
STARTMENU,
STARTUP,
FONTS,
MYPICTURES,
LOCAL_APPDATA,
COMMON_APPDATA,
COMMON_DESKTOPDIRECTORY,
COMMON_DOCUMENTS,
COMMON_PROGRAMS,
COMMON_STARTMENU,
COMMON_STARTUP,
COMMON_PICTURES,
MYVIDEO,
MYMUSIC
 
5. Pseudo environment variables from parameters of the function SHGetKnownFolderPath. Syntax: %$Name%
The following variables are supported:
AccountPictures,
AdminTools,
CameraRoll,
CDBurning,
CommonAdminTools,
CommonOEMLinks,
CommonPrograms,
CommonStartMenu,
CommonStartup,
CommonTemplates,
Contacts,
Cookies,
Desktop,
DeviceMetadataStore,
Documents,
Downloads,
Favorites,
GameTasks,
History,
ImplicitAppShortcuts,
InternetCache,
Libraries,
Links,
LocalAppData,
LocalAppDataLow,
LocalizedResourcesDir,
Music,
NetHood,
OriginalImages,
PhotoAlbums,
Pictures,
Playlists,
PrintHood,
Profile,
ProgramData,
ProgramFiles,
ProgramFilesX64,
ProgramFilesX86,
ProgramFilesCommon,
ProgramFilesCommonX64,
ProgramFilesCommonX86,
Public,
PublicDesktop,
PublicDocuments,
PublicDownloads,
PublicGameTasks,
PublicLibraries,
PublicMusic,
PublicPictures,
PublicRingtones,
PublicUserTiles,
PublicVideos,
QuickLaunch,
Recent,
ResourceDir,
Ringtones,
RoamingAppData,
RoamedTileImages,
RoamingTiles,
SampleMusic,
SamplePictures,
SamplePlaylists,
SampleVideos,
SavedGames,
SavedPictures,
SavedSearches,
Screenshots,
SearchHistory,
SearchTemplates,
SendTo,
SidebarDefaultParts,
SidebarParts,
SkyDrive,
SkyDriveCameraRoll,
SkyDriveDocuments,
SkyDrivePictures,
System,
SystemX86,
Templates,
UserPinned,
UserProfiles,
UserProgramFiles,
UserProgramFilesCommon,
Videos,
Windows
 
6. Passing a GUID directly to the function SHGetKnownFolderPath. Syntax: %${GUID}%
Example:
%${374DE290-123F-4565-9164-39C4925E467B}%  -> download folder, same as %$Downloads%