Directory-sensitive .desktop file?

I want to create a .desktop file that is able to run an executable located in the same directory. According to the documentation, %k stands for the path of the desktop file, but not its directory. Is there a way to get its location in order to be able to execute the appropriate file?

“~/Desktop” represents the current user Desktop folder. It is not normal to place an executable in the Desktop and you can create a Link To Application (*.desktop) that points to any application and make the working directory ~/Desktop if you want. What program are you trying to run?

Thank You,

It is not necessary to have the executable in ~/Desktop; if you right click and Create New/Link to application and then examine its Properties, you will find an option under Application to set a work path as well as a command name.

If you put the executable in ~/Desktop, you may have to specify ~/Desktop as the work path - not sure if KDE will look in ~/Desktop for an executable.