Delphi: Read out folder of our own application
Tip by Delphian | 2012-07-17 at 21:58
Delphi and Lazarus make it easy for us to get the directory, in which our application exe file is saved. This line of code gives us the path of our program:
// path is a string path := ExtractFilePath(ParamStr(0));
ParamStr(0) contains the full path and file name of our application. With the help of ExtractFilePath(), we extract only the path.
Alternatively, you can also use Application.Exename instead of ParamStr(0). Application.Exename also contains the complete path and the filename of the application.
About the Author
The author has not added a profile short description yet.
Show Profile
Related Topics
Rename File to its Folder Name
Tutorial | 0 Comments
Windows Batch Script: Computer Shutdown
Tutorial | 2 Comments
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
Rewrite Text Files with a fixed Line Length
Tutorial | 0 Comments
Put Windows via Script into Hibernation or Sleep Mode
Tutorial | 0 Comments
How to resize Image before Upload in Browser
Tutorial | 13 Comments
Lazarus: Load File as Byte Array and save Byte Array as File
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.