Somehow file associations .bat and .cmd (possibly .exe also) became associated with Notepad++ on Windows Server 2012. As a result, the "Run as Administrator" context menu option is NOT available for any files of these types. None of the options shown in the article at https://kb.abacusprivatecloud.com/articles/488-How-To-Change-Default-Programs-Applications worked. I tried associating .bat with cmd.exe, but the system simply sat "grindging away" for quite a while, then the panel came back, but no change was made in association.

How can I reset these file types back to their default associations?

  1. Go to the Registry Editor by pressing WinKey+R and typing in regedit.
  2. Navigate to the folder (key) Computer\HKEY_CLASSES_ROOT\batfile\shell\.
  3. Check if a key named runas exists under the shell key. If not, create the key by right-clicking on shell and clicking on New > Key. Call this key runas.
  4. This next step is not possible in the regedit graphical interface. Open a command prompt window as an administrator and run this command:

    reg add HKEY_CLASSES_ROOT\batfile\shell\runas\command /ve /t REG_EXPAND_SZ
  5. Back in the regedit window, go to the batfile key and press F5 (View > Refresh). You then should see the command key listed under the runas key.

  6. Edit the (Default) value in the runas\command key to this value:

    %SystemRoot%\System32\cmd.exe /C "%1" %*
  7. For cmd files, run the same steps above for the HKEY_CLASSES_ROOT\cmdfile\shell key.


Apparently someone logged onto this server and dd something to correct the problem. The .bat file I had been trying to Run as Administrator, now has that option in the context menu. I have no idea who may have corrected the problem, but everything seems to be working as it should at the present time. Thanks for the response nevertheless.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy