Take the 2-minute tour ×

I've created 2 batch files. The first called admin.bat with the lines:

@echo off
runas /env /user:ADOMAIN\Administrator "\\path\dir\explorer.bat"

and the other called explorer.bat with the lines:

explorer.exe /separate, %userprofile%\desktop
explorer.exe /separate, \\path\dir

Now you can see the first batch launches the second with Admin priviledges but when the second launches I can see %userprofile%\desktop but the cmd window stalls and doesn't run the second command:

explorer.exe /separate, \\path\dir

If I close the %userprofile%\desktop window the second command pops-up the \path\dir. In short, all I want to make is a runas command that launches 2 explorer.exe instances entering the admin password just once...Can anyone help me?

share|improve this question

migrated from stackoverflow.com Mar 18 '11 at 13:13

This question came from our site for professional and enthusiast programmers.

What operating system? I have tried it in Windows 7 and it works exactly as you would like it to. –  Majenko Mar 18 '11 at 13:18
Using it in Windows XP in a Power User environment...i know that if u open it as Administrator it works perfect...but the fact is it should be run by Power User. –  user72326 Mar 18 '11 at 13:34
@frost Register your Stack Overflow account with the same as you did here to regain control of this question and stop flooding with non-answers –  random Mar 18 '11 at 16:56

1 Answer 1

The batch file is waiting for the first explorer to terminate before launching the second one.

The solution is to use the Start command to launch both explorers in separate windows :

start explorer.exe /separate, %userprofile%\desktop
start explorer.exe /separate, \\path\dir
share|improve this answer
Cool! Now it worked on my VMWare XP machine...but i've tried it on a domain and it didn't worked even with the START command. Another related question: In my Windows 7 machine im the Administrator with the user (ex Asd) and Password (asdasd) and i've added the same Administrator user (Asd) in the VMWare XP machine but with password (asd) [not asdasd]..the fact is that when the runas prompts me to put the password i've to put the admin xp machine password and not the W7 admin password and the explorer opens it as well even if i've not put the W7 Admin password..Any clues? –  user72326 Mar 18 '11 at 13:39
(1) The start command is not dependent on the domain. (2) In the VM use the password of the VM's asd account. –  harrymc Mar 18 '11 at 15:26

Your Answer

