.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

run process as another user?

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
171 Views, 3 Replies

run process as another user?

I just noticed when issuing a system.diagnostics.process.start method that you can tell it the prog name, then a
username and password!
Does this mean I can finally build into my programs, the ability to run a prog as an admin while my users are logged on?
This would be so stinking handy, anyone tried it?
thx
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

Yes, you can have your program start another app/process to "RunAs" admin,
as long as you supply the password.

However, you wouldn't want to hard code the password, would you? If you hide
the username/password somewhere, you'd need to make sure it is absolutely
safe, also you have to handle the situation when password is changed,
expired...

The usual approach would be, prior to call Process.Start(), you show a login
dialog to allow user to enter username/password. So, you do not need to hide
username/password somewhere. Only users who are the designated user or kow
the username/password will be able to proceed. This is equivalent to
right-click an exe program in Windows Expelorer and then select "Run as...".


"James Maeding" wrote in message
news:5432182@discussion.autodesk.com...
I just noticed when issuing a system.diagnostics.process.start method that
you can tell it the prog name, then a
username and password!
Does this mean I can finally build into my programs, the ability to run a
prog as an admin while my users are logged on?
This would be so stinking handy, anyone tried it?
thx
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Message 3 of 4
Anonymous
in reply to: Anonymous

interesting, I thought I had tried the run as.. before but maybe I need to look again.
thanks

Norman Yuan
|>Yes, you can have your program start another app/process to "RunAs" admin,
|>as long as you supply the password.
|>
|>However, you wouldn't want to hard code the password, would you? If you hide
|>the username/password somewhere, you'd need to make sure it is absolutely
|>safe, also you have to handle the situation when password is changed,
|>expired...
|>
|>The usual approach would be, prior to call Process.Start(), you show a login
|>dialog to allow user to enter username/password. So, you do not need to hide
|>username/password somewhere. Only users who are the designated user or kow
|>the username/password will be able to proceed. This is equivalent to
|>right-click an exe program in Windows Expelorer and then select "Run as...".
|>
|>
|>"James Maeding" wrote in message
|>news:5432182@discussion.autodesk.com...
|>I just noticed when issuing a system.diagnostics.process.start method that
|>you can tell it the prog name, then a
|>username and password!
|>Does this mean I can finally build into my programs, the ability to run a
|>prog as an admin while my users are logged on?
|>This would be so stinking handy, anyone tried it?
|>thx
|>James Maeding
|>Civil Engineer and Programmer
|>jmaeding - athunsaker - com
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Message 4 of 4
Anonymous
in reply to: Anonymous

I don't know what this has to do with AutoCAD .NET development, but...

Attached is a managed wrapper around the Windows "password" dialog which
makes getting the password from the user reasonably secure. Note that the
"password" parameter is a SecureString (new in .NET 2.0), this class goes to
some lengths to keep you from doing the "wrong thing" with a password.

Dan

"Norman Yuan" wrote in message
news:5432279@discussion.autodesk.com...
Yes, you can have your program start another app/process to "RunAs" admin,
as long as you supply the password.

However, you wouldn't want to hard code the password, would you? If you hide
the username/password somewhere, you'd need to make sure it is absolutely
safe, also you have to handle the situation when password is changed,
expired...

The usual approach would be, prior to call Process.Start(), you show a login
dialog to allow user to enter username/password. So, you do not need to hide
username/password somewhere. Only users who are the designated user or kow
the username/password will be able to proceed. This is equivalent to
right-click an exe program in Windows Expelorer and then select "Run as...".


"James Maeding" wrote in message
news:5432182@discussion.autodesk.com...
I just noticed when issuing a system.diagnostics.process.start method that
you can tell it the prog name, then a
username and password!
Does this mean I can finally build into my programs, the ability to run a
prog as an admin while my users are logged on?
This would be so stinking handy, anyone tried it?
thx
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost