473,811 Members | 2,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Launch an application as Administrator

I'm using the Process.Start method to launch an application from C#.
How can I launch the App as Administrator in Windows Vista?
Thanks.
Andrea
Jun 27 '08 #1
5 4737

<na***@communit y.nospamwrote in message
news:h5******** *************** *********@4ax.c om...
I'm using the Process.Start method to launch an application from C#.
How can I launch the App as Administrator in Windows Vista?
You can set the program to have Admin privileges by using Run As
Administrator with Vista UAC manifest that the program will present the
credentials to Vista, look it up use Google.

Jun 27 '08 #2
Thanks for the quick reply Arnold. Can you be a bit more precise,
please?
I don't have the username and password of the administrator. I've
created a shortcut launch application and I would like it to display
the UAC prompt asking for the permission to raise privileges. Do you
have an example to do that?
Thanks.
Andrea

On Sat, 21 Jun 2008 02:47:13 -0400, "Mr. Arnold" <MR.
Ar****@Arnold.c omwrote:
>
<na***@communi ty.nospamwrote in message
news:h5******* *************** **********@4ax. com...
>I'm using the Process.Start method to launch an application from C#.
How can I launch the App as Administrator in Windows Vista?

You can set the program to have Admin privileges by using Run As
Administrato r with Vista UAC manifest that the program will present the
credentials to Vista, look it up use Google.
Jun 27 '08 #3

<na***@communit y.nospamwrote in message
news:4e******** *************** *********@4ax.c om...
Thanks for the quick reply Arnold. Can you be a bit more precise,
please?
I don't have the username and password of the administrator. I've
created a shortcut launch application and I would like it to display
the UAC prompt asking for the permission to raise privileges. Do you
have an example to do that?
If you have created a short-cut for the start application, the Run as Admin
should/might be be there on the short-cut off of Properties/Advanced Button
to set it permanently. If someone runs the application with standard user
rights, then the user must know an Admin account with the user-id and psw.
An Admin running the application won't be asked for credentials but will be
prompted to allow or dis-allow.

The one you should be worried about is the application you're trying to
start form the application with your Start . Net Net statement and its
credentials to start and execute.

Again, use Google and look up *how to use the UAC manifest from a .Net
program to give elevated credentials for an .Net program. There are plenty
of information out there concerning this.

Jun 27 '08 #4
I'm sorry but this is not very clear to me, yet.
I don't need to start my application with elevated rights but I need
to start another application from inside my application with elevated
rights.
I don't want to store the password inside my app. Basically I would
like to replicate the functionality of the "Start as admin" item in
the context menu that appears when you right click on an executable
file in Windows Vista.

I just need some C# sample code do it. Can you point me to it?
Thanks.
Andrea
Jun 27 '08 #5

<na***@communit y.nospamwrote in message
news:14******** *************** *********@4ax.c om...
I'm sorry but this is not very clear to me, yet.
I don't need to start my application with elevated rights but I need
to start another application from inside my application with elevated
rights.
I don't want to store the password inside my app. Basically I would
like to replicate the functionality of the "Start as admin" item in
the context menu that appears when you right click on an executable
file in Windows Vista.

I just need some C# sample code do it. Can you point me to it?
http://www.google.com/search?hl=en&q...=Google+Search

Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2817
by: Bob Bedford | last post by:
I've a script that must "launch" an other script on some situations. firstscript.php: .... If ($newarticle) //launch secondscript.php .... The "secondscript.php" may take quite long, and is not necessary in "firstscript.php" to wait until it's finished. So how to launch
1
5913
by: Michael Howes | last post by:
I have a c# windows form that talks to a web service on a server that then can talk to multiple "agents" on different machines using web service calls. I want to be able to launch an application of the users choice on the remove, "agent" machine. I've discovered that Process.Start() won't work because it runs under asp.net and it will launch any "process" but if the application has a windows UI it will not show.
5
32754
by: GrantS | last post by:
Hi I am trying to use ShellExecute to launch an application to display a certain file. The variation on the theme is that I need to be able to specify the application to launch and not simply pass the file name (which will then result in the application associated with the file extension to launch). I want to prevent the application registered in the system as being associated with the file extension from opeing the file.
1
3970
by: Chris | last post by:
Does anyone know how to programmatically launch the ODBC Data Source Administrator dialog? Thanks.
4
20919
by: Joe | last post by:
I created a CustomAction for this but I don't think I have it in the right place. I tried both Install and Commit but neither allow it to get to the final screen. Are there any examples of this anywhere? Thanks, Joe
8
1988
by: Marcus | last post by:
I have this application I have made that I launch when the user logs into Windows XP. I would like to delay the launch of the application so that it starts 1 minute after the user has logged in. I previously did this with a sleep at the first row of the source code, but this makes the process visible in the task manager's processes tab during the sleep (before the "real application" is actually running), and I dont want that.
5
20083
by: cooltoriz | last post by:
Hello there, I am not asking how to impersonate a process within C# windows application. I already know that, in C# v2.0, you can easily achieve it using ProcessStartInfo. You can run a process or call external program as of different user. The problem of that design is that the mother application is still running as current user. I know that less privilege is more secure.
7
4671
by: dongarbage | last post by:
Hi there, I'm very new to activex controls and c# programming. I'm writing a c# application and I want it to be invoked when my users click a button on a web page. Its an application with a GUI so the app would come up and be running independent of the web browser (i.e. not embeded in it). Also note, that this application is one that is already installed
1
1659
BezerkRogue
by: BezerkRogue | last post by:
I have created a VB Script to synchronize software versions and then launch an application on the system it is run against. The script runs and generates no errors but will not launch the second application. The application name is dynamic and is selected from table. WScript.Echo verifies that it is calling the correct application and the path statement is correct. Also the application does reside where I am calling it from. The code...
0
9724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.