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.
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
farhankazi that has made it alot simpler and easy to understand thanks.
ASKER
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.