I do not know any other application that does this.
If I run two copies of Visual Studio, let's say I expect the settings of the last instance are closed so that they are saved.
If you assign a unique identifier (GUID) to an instance, how do you reuse this value the next time you launch the application? Or do you want to get a new set of values โโevery time you start the application?
If you want to reuse, you can create numbered subdirectories (1, 2, 3, 4, etc.), and each time you launch the application, write a lock file to this directory. Then check for the lock file and increase the number until you find the unlocked folder.
UPDATE
In the light of the added comment - why not get the path to the executable and create a folder under it?
If the user does not have rights to this folder, you will need to create some kind of mapping between the location and the GUID (say), which you then added to the application settings and the user settings path.
source share