Issues with batch file to run MMC with elevated account


  1. Posts : 139
    Windows 7 Home Premium 64bit
       #1

    Issues with batch file to run MMC with elevated account


    Hey all. I'm trying to create a batch file to run an MMC using an elevated account. I'm a novice when it comes to batch files, but this is what I have so far is:

    runas /user:domain\account "mmc C:\SuperConsole.msc"
    pause

    While I'm not including the domain or account info in this post, the file location is the same. I put the pause in it so I can see the error that I'm getting since I know that the MMC is not popping up.

    So, I run the batch file and the CMD prompts for the password. I input the password and I receive the below error:

    RUNAS ERROR: Unable to run - mmc C:\SuperConsole.msc
    740: The requested operation requires elevation.

    This is where I am perplexed. The account I'm running as is an elevated account. I've tried everything from removing the quotes, using my standard account, and placing mmc outside the quotes. I've also tried running a CMD as my elevated account and it comes up fine. Thoughts?
    Last edited by ruste84; 26 Feb 2013 at 15:41. Reason: Language was incorrect.
      My Computer


  2. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #2

    Just to confirm, are you running the .BAT files as administrator?

    Try placing the .BAT file on your desktop, and then right-click and select 'Run as administrator'

    Regards,
    Golden
      My Computer


  3. Posts : 139
    Windows 7 Home Premium 64bit
    Thread Starter
       #3

    Hello Golden. I just tried that and I received the same error.
      My Computer


  4. Posts : 6,830
    Windows 7 Ultimate 32-Bit & Windows 7 Ultimate 64-Bit
       #4

    See if this will work for you

    Make a shortcut of the bat file then do this

    Right-click the new shortcut, and then click Properties.
    On the Shortcut tab, click the Advanced button.

    Select the Run as administrator checkbox.
      My Computer


  5. Posts : 139
    Windows 7 Home Premium 64bit
    Thread Starter
       #5

    Hello VistaKing. I still received the error.
      My Computer


  6. Posts : 6,830
    Windows 7 Ultimate 32-Bit & Windows 7 Ultimate 64-Bit
       #6

    Whose account are you trying to use ? Your own or the Local Administrator ?

    See if this will help http://blog.remarqable.com/2011/12/0...-domain-admin/

    Added : Try this command runas /profile /env /user:domain\account "mmc C:\SuperConsole.msc"

    see if it works
      My Computer


  7. Posts : 139
    Windows 7 Home Premium 64bit
    Thread Starter
       #7

    Voila! That did it. It never occurred to me to run the shortcut of the batch file using Run as Administrator. Lesson learned. Thank you!
      My Computer


  8. Posts : 6,830
    Windows 7 Ultimate 32-Bit & Windows 7 Ultimate 64-Bit
       #8

    That's good that you got it working . Glad to help .
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:01.
Find Us