473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to execute a exe with Admin account from a console application ?

Hi,

I need to automize installation of exe and files on different versions
of Windows (except 95) from a console application. It includes shortcut
creation for all users wich requires more privileges then those of the
current user. So, does any body know if it's possible to run a exe with
more privilege than those of the connected user form a console
application ?

Thanks and best regards
Gilles
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
2 9155
Hi Gilles,

I have to say that you may not be able to achieve this without enough
privileges. Without Administrator's permission, you can't create short cut
for other people with a normal account.

Anyway, if you already know a local administrator's account and passqord,
you may execute the problem from "RunAs" command (only one Windows 2000, XP
and 2003), for more information on this, you can type "runas /?" in DOS
command line window, or refer to this article:

HOW TO: Enable and Use the "Run As" Command When Running Programs in Windows
http://support.microsoft.com/default...;EN-US;Q294676

Hope this answer your question,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 20 '05 #2
Hello,

"Gilles LAMBERT" <we*******@tutorials-online.com> schrieb:
I need to automize installation of exe and files on different
versions of Windows (except 95)
Huh... .NET applications won't run on Windows 95.
from a console application. It includes shortcut
creation for all users wich requires more privileges then
those of the current user. So, does any body know if it's
possible to run a exe with more privilege than those
of the connected user form a console application ?


You may use the 'ImpersonateLoggedOnUser' Win32-API function through
PInvoke:

VB6 sample (to be translated to VB.NET):

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

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3

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

Similar topics

12
by: Google Mike | last post by:
You know, while working on my moonlight corporation's LAMP project at home this weekend, I couldn't help but wonder if people writing similar projects are solving similar problems with having to...
1
by: Sushant Bhatia | last post by:
Hi. I'm working at Arizona State University on a project that is developing software for individuals who are blind and I need to be able to setup an App that we are creating to run with...
1
by: Dean R. Henderson | last post by:
I have a Windows library that I bind into a Windows Form application and into an ASP.NET Web Application. I have a procedure in the library that executes a DTS Package. I have also used...
4
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service...
0
by: Eric Butler | last post by:
I am trying to get user information out of AD (specifically the memberOf property) from an ASP.net page and am having a strange problem. If the user I query for is an administrator in the domain...
2
by: DB | last post by:
Hi All, I have to execute dos command containing batch file using asp.net application. Code for batch file execution is working properly when I tried it with console application but same code...
1
by: SStory | last post by:
When you run a service you can execute an app under a different account. I need to do that with a normal app. I need to run it as admin, even though I am not logged in as admin. How can I do...
0
by: Chad Dressler | last post by:
I'm trying to use System.DirectoryServices to add a domain user to a local group via a web application which runs under the identity of a local admin account. Is this possible? I can...
0
by: Big Charles | last post by:
Hello, Programming in VS2003-ASP.NET 1.1, I have this problem: Using DirectoryEntry and without any admin user, how can I check if a domain account, that try to login, has expired? Scenario: User...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.