Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have written as small .cmd file to be executed as an administrator. I am trying to set its options as 'Run as Administrator' but the check box is not accessible.

Run As Administrator

Why? How to solve this issue? I am administrator on my PC (Windows 7).

share|improve this question

migrated from serverfault.com Sep 21 '11 at 18:40

This question came from our site for professional system and network administrators.

add comment

2 Answers

up vote 3 down vote accepted

Create a Shortcut to the .CMD you want to launch (Right-click-->Create Shortcut, or drag-drop with Alt pressed)

Go into the shortcut's Properties-->Shortcut Tab-->Advanced-->Check-mark Run as Administrator

Then launch with the Shortcut instead.

share|improve this answer
    
Thanks. It did the trick. For the records: I had to create a 'set location=C:/Users/etc...' variable in my .cmd and use it with each command to make it work. –  JVerstry Sep 21 '11 at 19:47
    
Glad it worked. Have you considered setting the environment variable permanently instead? Check out SetX, and/or this question: how to set path environment variable amongst others, for some info on that. :) –  techie007 Sep 21 '11 at 20:02
    
The thing is that I may need to modify it in the future and it is only used in the .cmd. It's not really necessary to make it global (in my case). –  JVerstry Sep 21 '11 at 20:27
add comment

runas might come to some use for you

share|improve this answer
    
Keep in mind runas only elevates commands if you use the builtin Admin account's credentials and you have autoapproval mode on. Otherwise this will fail due to UAC. –  surfasb Sep 21 '11 at 21:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.