473,749 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Run my program under other user

I have a program that has to run under the administrator
account. But the use that will start the program has it's
own (limited) account.

How can I run a program under administrator?

I'd like solution that is a secure as possible. So not
using run as or something on command prompt.
Nov 20 '05 #1
4 1367
Look into impersonation. It's a little confusing, but sounds like what you
may be looking for. Most examples are in ASP.NET (I think all of them are,
but don't see why you couldn't still use it).

-CJ
"Philip Wagenaar" <p.********@acc on.nl> wrote in message
news:08******** *************** *****@phx.gbl.. .
I have a program that has to run under the administrator
account. But the use that will start the program has it's
own (limited) account.

How can I run a program under administrator?

I'd like solution that is a secure as possible. So not
using run as or something on command prompt.

Nov 20 '05 #2
Philip I'm not sure if this is what your looking for but
if you add a setup and deployment project to your
solution after compilation when you initially install
your application the setup wizard will give you the
standard option of enabling the application for 'me only'
or 'anyone who uses this computer' if your looking for
something more sophisticated than this you will have to
wait for an experts response

Regards Steve
Nov 20 '05 #3
You have two options here:-
1) If your program has to have administrative privileges to run because of
specific registry access or file access - login as an administrator and set
permissions against the registry entries or files for your program.

2) There are examples around on the net in VB that allow you to run your
program as another user - its the same as Run As but coded into your
program - only trouble here is that you need to store the user and password
within the program which could be viewed through a hex editor or decompiled.
Possible ways around this though is to store the user name and password
within the program encrypted, and within your program have a decryption
routine - although this doesn't necessarily get around decompilation of your
program.

Merlin

"Philip Wagenaar" <p.********@acc on.nl> wrote in message
news:08******** *************** *****@phx.gbl.. .
I have a program that has to run under the administrator
account. But the use that will start the program has it's
own (limited) account.

How can I run a program under administrator?

I'd like solution that is a secure as possible. So not
using run as or something on command prompt.

Nov 20 '05 #4
* "Philip Wagenaar" <p.********@acc on.nl> scripsit:
I have a program that has to run under the administrator
account. But the use that will start the program has it's
own (limited) account.

How can I run a program under administrator?

I'd like solution that is a secure as possible. So not
using run as or something on command prompt.


VB6 sample for "impersonation" :

<http://www.gssg.de/impers.zip>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

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

Similar topics

2
14168
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip Smarty-2.6.7.tar.gz on a system running WindowsXP SP2. Apache and PHP tested out fine. After adding Smarty, I ran the following http://localhost/testphp.php
2
4678
by: atreide_son | last post by:
hello all... yes i'm a newbie and i need help. i have an assignment due for class, but I don't know i'm stuck and can't get out from under myself. here's the focus of the program: Write a C program that allows the user to make some simple banking
6
7578
by: Nicky | last post by:
hi,all We are going to develop a program and when it is running, we need it full screen and also, user can not switch to other place before exit our program. I am thinking, we can make a window full screen, but how to avoid user switching to other program or windows? And also, there are many hot keys, how to capture or disable these things? Thanks
1
4296
by: siliconpiNOSPAM | last post by:
Hi, I have a C# test program (setup as a console application) that runs a bunch of other programs like IE / etc. I run this program from a command window, the other windows cover the command window and I cannot see the log being generated. In the program execution, there are lots of delays necessary and many times when the program fails to function properly and has exited, I cannot tell whether it is in a delay loop or has exited (as...
0
864
by: Les | last post by:
Hi, I have a C++ application that I have built using MS VC++ .NET. I would like to set it up/convert it for multiple users to run it from the web. What do I need to do to make this available to users. The scenario that I envision is a user connect to the web using a browser (eg. Internet Explorer), goes to a web page containing access to the program, registers for the program's use (eg. credit card info. etc, billing information etc),...
9
11527
by: kwindham | last post by:
This program doesn't seem like it should be too hard, but I cannot figure it out. Here is the assignment: Password Verifier - Write a program to verify passwords, satisfying the following specifications: ALGORITHM: 1. Ask the user to input a possible password. 2. Check to see that it: - is at least 8 characters long
2
5461
by: James MA | last post by:
I'm writing a program to handle multiple tasks in a single batch, which may take few minutes to complete all tasks. To reduce the impact to user, no windows form will be displayed, instead I have create a NotifiyIcon for the program, it can show the current status whenever user put the mouse over the tray icon. As it takes time to complete all tasks, user may want to terminate the job for some reason. I have added the ContextMenu for...
7
2181
by: Buck Rogers | last post by:
Hi all! Newbie here. Below is an example from Teach Yourself C in 21 Days. My apologies if it is a bit long. What I don't understand is how the "get_data" function can call the "continue_function", and if NO is returned to "get_data", display_report executes and the program ends? Basically I am having trouble understanding the program flow within the "if" loop in the "main" function.
1
2517
by: Kayvine | last post by:
Hi guys, this is a question I have for an assignment, it is pretty long, but I am not asking for the code(well if someone wants to write I'll be really happy, lol), but I just want to know how to start it and what main topics in C I will need to cover in the assignment. Thanks a lot. CSC180 Assignment #3: Menu Madness Due Date: Thursday, November 8th at 1:00am Contents: · General Info · What to Hand In o Submission Instructions
2
19345
Banfa
by: Banfa | last post by:
Posted by Banfa The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how we set about doing that. Every program starts with a specification, this may be a several hundred page document from your latest client or one small paragraph from your professor and pretty much anything in-between. The specification is very...
0
8833
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
9568
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
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
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
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4709
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
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.