Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using "Run..." creates a different user.config

My application connects to different databases. The connection strings are saved in the user settings. I cannot use the application scope because the data is changed at run-time.

If the user starts the application normally there is no problem. However, if he uses the "Run..." command from the Start menu then a different folder in User\AppData\Local\MyApplication is created containing a different user.config.

Is there any way to stop or bypass this behavior?

like image 205
F. H. Avatar asked Feb 06 '13 12:02

F. H.


People also ask

How do I always Run a program as a different user?

Just find an application (or a shortcut) you want to start, hold the Shift key, and right-click on it. Select Run as different user in the context menu.

What does run as different user do?

RunAs and “Run as different User” allow a user to start an application with different user credentials. When one of these functions is performed, an authentication occurs and a new process will be created with the specified user account.

How do I disable run as another user?

Use Software Restriction Policies or AppLocker to prevent access to the Runas.exe binary file. Use Group Policy to remove the Run as different user menu item. The Group Policy Object (GPO) changes to User Configuration\Administrative Templates\Start Menu and Taskbar\Show "Run as different user" command on Start.

Can you Run CMD as a different user?

To “Run as different user” using Context MenuRMB click on any BAT, CMD, EXE, MSC, or MSI file, and choose Run as a different user. 4. Now an app will be running as a new user.


1 Answers

This behavior cannot be avoided.

It seems that Windows does not identify programs started by other programs as the same as programs which are run by the user.

To solve the problem you have to avoid settings made by the ConfigurationManager and create your own files to save data as pointed out in the comments.

like image 173
F. H. Avatar answered Oct 06 '22 02:10

F. H.