Since creating a shortcut is part of the workflow, just set the working directory to "% cd%" for the shortcut, then in the application use:
Environment.CurrentDirectory
Obviously, you will want to commit this value before any code that your application calls may change.
When creating a shortcut using Windows Explorer, you cannot set the working directory. So, having created it, open its properties page by right-clicking on it and selecting "Properties", then set the Start field to %cd% . After creating such a shortcut, you can move or copy it to the folders in which you want the application to start.
source share