Solved

Command prompt UAC

Posted on 2007-03-23
5
958 Views
Last Modified: 2012-06-21
I'd like to run a command in my batch file as an Administrator.

If this was linux, I'd have su -c ... or sudo to prompt me for a password to run as root. In Windows, I'm happy with the UAC dialogue, but how to make it happen in my .cmd file to elevate the privileges for that command only.

It doesn't seem right to have to run the entire batch file as administrator, by right-clicking etc.

[For what it's worth, the command is regasm, which quite rightly needs admin privileges.]
0
Comment
Question by:rstaveley
  • 3
5 Comments
 
LVL 59

Accepted Solution

by:
LeeTutor earned 500 total points
ID: 18780593
0
 
LVL 70

Expert Comment

by:KCTS
ID: 18780688
You could open a command window as administrator
Click on Vista Start button
Click on Run
Type in CMD [Enter]
You should see “This task will be created with administrative privileges”
Click on OK or press [Enter]
0
 
LVL 17

Author Comment

by:rstaveley
ID: 18780785
Just tried the manifest approach with no joy.

All of the other mechanisms involve elevanting the privileges for the entire batch file.
0
 
LVL 17

Author Comment

by:rstaveley
ID: 18780793
> elevanting

elevating
0
 
LVL 17

Author Comment

by:rstaveley
ID: 18801122
I guess not.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
WINDOWS VISTA 8 676
Outlook 2003-duplicate Emails 8 428
IE Add-ons Remove 11 124
Video problems on Dell Inspiron One 2330 15 496
The Service applet starts in Extended Mode by Default, with a taskpad on the left of the services pane. This view mode was introduced in XP. As I find it not very usefull, I like to use the Standard view as default, and without the Console tree. …
There are many reasons a PC runs slower than when it was new, ranging from malicious software intended to mess things up to simple general Windows use.  Your PC performance may slowly degrade over time without you noticing but when you buy a PC from…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question