Link to home
Start Free TrialLog in
Avatar of klt13
klt13Flag for United States of America

asked on

Running an executible with different credentials.

I have an Windows Application that requires to be executed as an Administrator. I have a user that does not have admin rights to run this program. I am wanting to write either a Window Forms application, or Windows Console application that would kick off the program and pass it the administrative credentials that I would hard code into the software that would get in turn compiled so that the user will never know the admin username and password. If someone could give me some links or examples of how i can make this happen, i would appreciate it very much. I prefer vb over c#.
Avatar of Ryan McCauley
Ryan McCauley
Flag of United States of America image

If you were to do this in .NET (VB or C#), the code could be de-compiled to show the password that you used, exposing your credentials if you hard-code them into your source. While this takes a little bit of know-how, it's not too hard with some free or trial applications on the market.

I've seen another program that does this, though I've never used it:

http://www.robotronic.de/runasspcEn.html

This should to the trick - it takes your credentials and compiles a wrapper for the application so it will launch as the account you want without the end user seeing the credentials. It appears to be free for personal use or about 4 Euros (they're in Germany) per computer you need to run it on if you're using it for a business.
There is another way to implement this - change the permissions on the application folders to grant the necessary permissions to the user.  See the discussion here:

How 2 have a permanent RUN AS ADMIN for one specific program ?

Also, what is the Operating System the user is running.  If it is Windows 7, you can set a specific shortcut to always run as administrator by right-clicking it and selecting the option.
ASKER CERTIFIED SOLUTION
Avatar of klt13
klt13
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of klt13

ASKER

not a priority at the moment