How to open a readme file

This is another newbie question. I want to have a button on my program that when clicked causes Windows to open a specific file (In my case it is “readme.txt”) in the same folder as the exe is located.

Firstly, how do I get the path of the running EXE?

Secondly, what commands do I use to cause Windows to open it?

lookup Path() in the help
You can display it in a window in a text control

Thanks for the tip about PATH()

I found a ShellExecute example in Richard Bryce’s example code on Github.

If C10 or C11, you can use OpenFileLink procedure from cwutil.inc, this is a wrapper around ShellExecute.

Hi Donn,

Easier to just use the Clarion RUN command with the Wait flag - it will open the program associated with files having the .TXT extension (usually Notepad.exe) eg

RUN(PATH() & ‘\readme.txt’,1)

Many thanks! That’s exactly what I was looking for. I got lost in the complexity of Richard’s example. I haven’t learned enough yet.