Solved

Command prompt UAC

Posted on 2007-03-23
5
961 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vista OS disk needed 5 581
Printer Spooler Service Failing Over and Over 9 543
LAptop Screen not showing properly 5 729
When Windows 7 start bootloader appear 3 148
Hi All Just a quick one for everybody. I was recently looking into setting the default User Account Picture for all my vista clients within the network but on closer inspection the group policy setting only allows you to set the default pictur…
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. …
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

751 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