Link to home
Start Free TrialLog in
Avatar of Nicky Raven
Nicky RavenFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Batch File tool box

Hello All

I have a small batch file as pasted below and I am unable to make this work as it only open's the first msc then just stops can anyone help and point out what I have done wrong as I will require all the msc's files and exe's opening as specific user.

if you know of a different way I'm open to suggestions

,
@runas /user:Domain\User "cmd /c \"start dsa.msc\"" && "cmd /c \"start tsadmin.msc\"" && "cmd /c \"start Exchange Management Console.msc"" && "cmd /c \"start wsus.msc"" && "C:\Program Files (x86)\Windows Resource Kits\Tools\lockoutstatus.exe"
'

for you info
Systems in use are Windows 7, Exchange 2010,, Windows Recourse Kit Tools, Admin tolls for Windows 7,

any other information needed just ask
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nicky Raven

ASKER

That worked perfectly thanks alot I had to state the location for wsus and the dos box stays open even after I have taken pause out so only small niggels but perfect and small things I can live with.

my rendition

@echo off
setlocal
if /i "%~1"=="/runas" goto Start
runas.exe /user:Domain\User "\"%~f0\" /runas"
goto :eof
:Start
echo Running as %UserDomain%\%Username%
start "" "dsa.msc"
start "" "tsadmin.msc"
start "" "Exchange Management Console.msc"
start "" "C:\Program Files\Update Services\administrationsnapin\wsus.msc"
"C:\Program Files (x86)\Windows Resource Kits\Tools\lockoutstatus.exe"

Open in new window

Sorted by little problem faster than I relized
Avatar of oBdA
oBdA

Then it's the lockoutstatus.exe that's keeping the command prompt open.
Just add a start ""  at the beginning of line 12, so that it looks like the rest:
start "" "C:\Program Files (x86)\Windows Resource Kits\Tools\lockoutstatus.exe"

Open in new window

Perfect thanks a lot for this super fast reply and solving my query, this will save me time getting all the admin programs up and running in the morning instead of shift right clicking then running as on all of then individually.