How can you run an application as another user in Windows 7? The only catch is that I don't want to have to hold down the shift key, right click on the application and choose Run as different user. I need it to automatically login using the login credentials I specify.
A script can be run as a task, but if we have to run an interactive application as another user, then creating a task does not work (as mentioned in https://superuser.com/a/903881/229612).
You will have to necessarily tick the box "Run whether user is logged on or not" and if you do that, the task will not show the user interface of the application.
The other approach of using runas with /savecred also has its own problems, as explained in that thread.
Dont know whether there is a solution for this.
Create a shortcut to your executable. Modify the "Target" under the shortcut's properties to:
runas /savecred /user:DOMAIN\USERNAME "path to executable"
- Right click then Run As Administrator the first time you use the shortcut, enter your password in the cmd prompt and press enter.
- Clicking the icon will then run as the user