ExpandToRealPath function
Return to Introduction  Previous page  Next page
Unit
acUtils  

Declaration
const  
  TOKEN_DESKTOP      = '%desktop%';  
  TOKEN_MYDOCUMENTS  = '%mydocuments%';  
  TOKEN_MYPICTURES   = '%mypictures%';  
  TOKEN_APPDATA      = '%appdata%';  
  TOKEN_PROGRAMFILES = '%programfiles%';  
  TOKEN_WINDOWS      = '%windows%';  
  TOKEN_SYSTEM       = '%system%';  
  TOKEN_TEMP         = '%temp%';  
  TOKEN_SAMPLES      = '%samples%';  
  TOKEN_HELP         = '%help%';  
  TOKEN_MEDIA        = '%media%';  
  TOKEN_CURSORS      = '%cursors%';  
  TOKEN_CURRENT      = '%current%';    
 
function ExpandToRealPath(const Path: String): String;  

Description
The ExpandToRealPath function searches the specified string for "keywords" (listed above), like %Windows% or %ProgramFiles%, and replaces them to the real pathes to the system folders.  
 
For example, line  
%programfiles%\My Application\MyExe.exe could be converted to  
C:\Program Files\My Application\MyExe.exe, or  
 
 %SYSTEMDIR%\mydll.dll could be converted to  
 C:\WinNT\system32\mydll.dll  
 
%Current%\Application.exe could be converted to  
D:\Projects\My Projects for SomeCompany\ProgramName\Beta2\Application.exe  

See also
GetSysDir function.