Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Issues with batch file to run MMC with elevated account

26 Feb 2013   #1
ruste84

Windows 7 Home Premium 64bit
 
 
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?


My System SpecsSystem Spec
.
26 Feb 2013   #2
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

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 System SpecsSystem Spec
26 Feb 2013   #3
ruste84

Windows 7 Home Premium 64bit
 
 

Hello Golden. I just tried that and I received the same error.
My System SpecsSystem Spec
.

26 Feb 2013   #4
VistaKing

Windows 7 Ultimate 32-Bit & Windows 7 Ultimate 64-Bit
 
 

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 System SpecsSystem Spec
26 Feb 2013   #5
ruste84

Windows 7 Home Premium 64bit
 
 

Hello VistaKing. I still received the error.
My System SpecsSystem Spec
26 Feb 2013   #6
VistaKing

Windows 7 Ultimate 32-Bit & Windows 7 Ultimate 64-Bit
 
 

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 System SpecsSystem Spec
26 Feb 2013   #7
ruste84

Windows 7 Home Premium 64bit
 
 

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 System SpecsSystem Spec
26 Feb 2013   #8
VistaKing

Windows 7 Ultimate 32-Bit & Windows 7 Ultimate 64-Bit
 
 

That's good that you got it working . Glad to help .
My System SpecsSystem Spec
Reply

 Issues with batch file to run MMC with elevated account




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
How to run cmd.exe elevated in batch script
Hi All, I am writing a dos batch file for windows7 and it has many commands which need elevated access to run. For elevation I am using elevate.exe. I am doing like below - set Elevation=elevate -wait cmd.exe /c %Elevation% "cd /d %CD% && xcopy /E /Y ...." %Elevation% "cd /d %CD% &&...
General Discussion
Issues with dimensions of DOS BATCH file on my Windows 7
Hello, I have recently bought my new laptop on which I have installed some (old) software which is used for accounting. That software is made in DOS. Maximum resolution of my laptop display is 1280 x 720 When I open my software using BATCH file (as I always did), DOS window becomes streched,...
General Discussion
Elevated command via batch file?
I've set up a Virtual Router as in this page, but what it doesn't tell you is that you need to re-run the elevated command netsh wlan start hostednetwork every time the computer boots or comes out of standby. Is there a way to run an elevated command via a batch file? Later ... I've just...
Network & Sharing
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
General Discussion
Elevated Task manager without UAC-prompt for a user-account ?
hi ! is it possible to have an "Elevated Taskmanager" without UAC-prompt on a user-account ? for obvious security-reasons, i always run on a user-account, except when doing system maintenance. i want taskmanager to show everything, so it would be really nice if it was possible to create a...
General Discussion
turn on guest account via batch file
Hi, not sure this really belongs to the network forum, but in the absence of a "User account" forum and given that my issue is about the "net user" command, I figured I would post it here. ---- I have a very weird issue here. I am trying to enable the guest account via command line and...
Network & Sharing


Our Sites

Site Links

About Us

Find 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 23:36.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App