Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Have a .bat file which needs to run as Administrator, but the option under properties is greyed out. Why is that when I have local admin rights on the computer?

share|improve this question
Are there any other file types that are doing the same thing? What version of windows are you using (ex: win vista home) – Codezilla Nov 28 '12 at 2:01
@Codezilla - It says its Windows 7. – Ramhound Nov 28 '12 at 2:09
does the .bat run fine? Do you have User Account Control (UAC) turned off? – Logman Nov 28 '12 at 2:26


I think there are different techniques involved when running stuff as admin. For applications, there is the compatibility tab. Those settings are stored in the registry. You will probably see some applications listed on your machine:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Persisted

A batch or cmd file is not an application. It's a script run by the application cmd.exe. Thus it is not handled by the application compatibility settings in the registry.

Further the batch-file has no way to store the information, that it should be run as admin.


But there's another way to do it:

  1. create a shortcut (link) to the cmd/bat file.
  2. in the shortcut properties, on the Shortcut tab, click the Advanced ... button
  3. check the run as Administrator checkbox.

Note that even in the shortcut properties, the run as administrator is grayed out on the compatibility tab. The runas-option is stored in the shortcut (.lnk) file.

On a side note

You could actually set the grayed out run as admin checkbox in the registry:

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

Create a REG_SZ key with the full path to your batch file and "RUNASADMIN" as value. (... or probably easier: check the 256 color option in the properties and edit the registry entry.) But this won't work. At least not for most files. That's probably why it was grayed out on the compatibility tab in the first place.

Anyway that's just what I deduced for me. I found no official documentation on this.

share|improve this answer

worse case scenario you could load cmd as administrator then run the bat.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .