Batch file to run MMC as a different domain user?

mlevy

New member
Pro User
Local time
6:02 AM
Messages
289
I'm stumped.
I have a batch file that I used on XP to run an MMC that I created for common management tasks. In the MMC I have the ability to run regedit as a root forest domain privileged user (for remote system registry editing), password resets (using AD) remote computer management, and several web links for common sites the team uses. I did this so it was all in one place and it worked awesome in Win XP. When I run the batch file it reports that the directory could not be found.

Here's the command in the batch file:
C:\WINDOWS\system32\runas.exe /savecred /profile /env /user:root forest domain account "mmc Admin_Tools.msc"

Obviously the account being used for the privileged access is put after the user switch.

Here is the error I get:

C:\Users\username\Desktop>C:\WINDOWS\system32\runas.exe /savecred /profile /env
/user:elevated username "mmc Admin_Tools.msc"
Attempting to start mmc Admin_Tools.msc as user "root forest domain account" ...
RUNAS ERROR: Unable to run - mmc Admin_Tools.msc
267: The directory name is invalid.

I have verified that runas is in the same place as in XP, as well as MMC. I have run the batch file with elevate access as well as run the command prompt with elevated access (in fact that was copied from an elevated command prompt). The account I'm running it on has admin rights on the box, though UAC is set, I own both the account this was run from and the "root forest" privileged account, this account is NOT a domain admin.

This is all being done on Win 7 Pro in a large enterprise domain environment. Again, this batch file worked and still works on Win XP in the same environment.

Thanks


I should add that the MMC console runs fine if I don't use the batch file.
 

My Computer My Computer

At a glance

Windows 7 Home Premium x64Phenom II X4 955 BE8 GB OCZ BE 1667EVGA GeForce GTX470 SC
Computer Manufacturer/Model Number
Home built
OS
Windows 7 Home Premium x64
CPU
Phenom II X4 955 BE
Motherboard
Asus Sabertooth 990FX
Memory
8 GB OCZ BE 1667
Graphics Card(s)
EVGA GeForce GTX470 SC
Monitor(s) Displays
BenQ 19"
Screen Resolution
1280x1024
Hard Drives
256 GB OCZ Vertex 3 SSD
2x WD 1 TB
1x WD 2 TB
PSU
Thermaltake 850W
Case
Coolermaster Cosmos 1000
Cooling
Air
Keyboard
Logitech
Mouse
Cyborg R.A.T 7
Internet Speed
Standard RR
Nobody?

I know we have some awesome how-to people here, maybe it should be in a different forum?
 

My Computer My Computer

At a glance

Windows 7 Home Premium x64Phenom II X4 955 BE8 GB OCZ BE 1667EVGA GeForce GTX470 SC
Computer Manufacturer/Model Number
Home built
OS
Windows 7 Home Premium x64
CPU
Phenom II X4 955 BE
Motherboard
Asus Sabertooth 990FX
Memory
8 GB OCZ BE 1667
Graphics Card(s)
EVGA GeForce GTX470 SC
Monitor(s) Displays
BenQ 19"
Screen Resolution
1280x1024
Hard Drives
256 GB OCZ Vertex 3 SSD
2x WD 1 TB
1x WD 2 TB
PSU
Thermaltake 850W
Case
Coolermaster Cosmos 1000
Cooling
Air
Keyboard
Logitech
Mouse
Cyborg R.A.T 7
Internet Speed
Standard RR
Hi!
I tried this and it works:
Code:
runas /user:Davide "mmc services.msc"
Can you try the same command as mine and see if it works?
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64 SP1 clean installAMD Athlon 64 X2 6400+4 GB2 x NVidia Geforce 8600 GTS
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1 clean install
CPU
AMD Athlon 64 X2 6400+
Motherboard
Asus M2N-E SLI
Memory
4 GB
Graphics Card(s)
2 x NVidia Geforce 8600 GTS
Sound Card
Trust 5.1 Surround USB
Monitor(s) Displays
Benq FP931 19"
Screen Resolution
1280x1024@32bit@75MHz
Hard Drives
1 x Western Digital 500GB SATA (OS installation), 2 x Seagate 320GB SATA, 1 x Seagate 250GB IDE (in external USB box), 1 x TrekStor 750GB USB
PSU
650W
Keyboard
Logitech Cordless Desktop EX 100
Mouse
Logitech Cordless Optical
Internet Speed
8192 kbps / 640 kbps
I'll try it tomorrow.

I'm also considering using Powershell for this rather than a batch file but I need to learn a little about it first.
 

My Computer My Computer

At a glance

Windows 7 Home Premium x64Phenom II X4 955 BE8 GB OCZ BE 1667EVGA GeForce GTX470 SC
Computer Manufacturer/Model Number
Home built
OS
Windows 7 Home Premium x64
CPU
Phenom II X4 955 BE
Motherboard
Asus Sabertooth 990FX
Memory
8 GB OCZ BE 1667
Graphics Card(s)
EVGA GeForce GTX470 SC
Monitor(s) Displays
BenQ 19"
Screen Resolution
1280x1024
Hard Drives
256 GB OCZ Vertex 3 SSD
2x WD 1 TB
1x WD 2 TB
PSU
Thermaltake 850W
Case
Coolermaster Cosmos 1000
Cooling
Air
Keyboard
Logitech
Mouse
Cyborg R.A.T 7
Internet Speed
Standard RR
Did not work. It tells me it requires elevation, even running from an elevated command prompt.
 

My Computer My Computer

At a glance

Windows 7 Home Premium x64Phenom II X4 955 BE8 GB OCZ BE 1667EVGA GeForce GTX470 SC
Computer Manufacturer/Model Number
Home built
OS
Windows 7 Home Premium x64
CPU
Phenom II X4 955 BE
Motherboard
Asus Sabertooth 990FX
Memory
8 GB OCZ BE 1667
Graphics Card(s)
EVGA GeForce GTX470 SC
Monitor(s) Displays
BenQ 19"
Screen Resolution
1280x1024
Hard Drives
256 GB OCZ Vertex 3 SSD
2x WD 1 TB
1x WD 2 TB
PSU
Thermaltake 850W
Case
Coolermaster Cosmos 1000
Cooling
Air
Keyboard
Logitech
Mouse
Cyborg R.A.T 7
Internet Speed
Standard RR
Back
Top