For example, I need to know, what is direct path to user's "My Documents" folder (i.e. in XP ENU, usually it's %HOMEDRIVE%%HOMEPATH%\<My Documents>, in XP RUS ...\<Рабочий Стол>, and, surely, user can change it to any another path, i.e. my is "E:\AllDocs\")
How to get this?
It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.
0
Answers
see e.g. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
If you need this also:
(in my meaning, "My Documents" is here)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
(and 'Shared Docs')
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
To read the Registry you can use the "Windos Scripting Host" Automation (WSHShell). There exist a function like "RegRead"
Regards
and, some example to move this to Tips'n'Tricks:
Function Locals
Examples/list of possible parameter strings:
Can you show the list of all possible parameters?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
To do this, have a variable defined as DotNet variable and RunOnClient=true parameter setup:
Name DataType Subtype Length
Environment DotNet System.Environment.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
And if you would like to access i.e. Local AppData folder for any file saving operation, get the path string without "\" at the end:
Folder := Environment.GetEnvironmentVariable('localappdata') + '\';
https://docs.microsoft.com/en-us/dotnet/api/system.environment.specialfolder