Solved

Command prompt UAC

Posted on 2007-03-23
5
951 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The main issue when installing Vista and XP in dual boot is when you have to reinstall any of the two when something fails, let's say a hard disk failure, a lost partition, virus, etc. What commonly happens is that you lose all your hard work config…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now