Link to home
Start Free TrialLog in
Avatar of bagz1
bagz1

asked on

Configuring a batch file to run apps as another user, with a username and password prompt.

We are changing the Network admin password at our company, and providing the individual analysts with their own network Admin accounts.

Currently due to policies/restrictions that are in effect within our company our analysts have to run batch files to access certain areas of our users PC's e.g Control panel, registry.

These batch files allow analysts to access the control panel, registry, local disk as the Network administrator giving them full access.

Example code:
runas.exe /user:domain\Administrator "explorer.exe /separate"

How can I change the code so that the batch file will prompt each analyst to enter their own Admin username and password and access these areas as themselves.
ASKER CERTIFIED SOLUTION
Avatar of Vorenus
Vorenus

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
SOLUTION
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 bagz1
bagz1

ASKER

I tried using the set command as you suggested.

SET /P Username=Enter your username:

Enter your username:

echo %Username%

runas.exe /user:%username% "explorer.exe /separate"

This seems to be working great.

Thanks for your speedy response Vorenus and a great solution.
Avatar of bagz1

ASKER

farhankazi that has made it alot simpler and easy to understand thanks.