General discussion

Locked

Batch FIle

By lkspecial ·
How can I run a batch file as adminitrator on a client machine. The client machine is logged on as a standard domain user.

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Batch FIle

by Joseph Moore In reply to Batch FIle

You need the RUNAS tool. It is a part of the Windows Resource Kit.
If this is a Win2K/XP machine, they have RUNAS built in. On those ones, you can just hold down the Shift key, then right-click on the BAT file, and choose Run As....
You then put in your Administrator login, password and domain (if it is a domain member), and click OK.

hope this helps

Collapse -

Batch FIle

by lkspecial In reply to Batch FIle

Poster rated this answer

Collapse -

Batch FIle

by lkspecial In reply to Batch FIle

Thanks for your information on Runas. It works. However I need the authentication to be automated. At the moment it prompts me / user for a password to run the exec as administrator.

Collapse -

Batch FIle

by mrjay67 In reply to Batch FIle

You could make a dummy account with admin rights only to the folder or program you are trying to run. I suspect you are trying to get something to install using the batch as just running a batch shouldnt require admin rights.

You could map the share and use the dummy account rights(add the login as a switch at the end of the map) you can do net use /? to get the general idea of how to do it. Although it took a few tries to get it just right as the example is not exact. If applicable deletethe map so access is not readily available. Once the batch is ran and if its no longer needed you could remove the dummy account.

this is something I did to get network printer drivers to install from my PC thorough a script.

Hopefully this will help or get you in a right direction.

Jason

Collapse -

Batch FIle

by mrjay67 In reply to Batch FIle

Keep in mind if the batch is kept unsecured locally or anywhere else the login name and password will be visable to the user. Make the login usable only where it is needed. Also if worried, either delete the batch, the account or both if neccessary to keep secure.

Collapse -

Batch FIle

by lkspecial In reply to Batch FIle

Poster rated this answer

Collapse -

Batch FIle

by BeerMonster In reply to Batch FIle

Hi,
I came up with a way of automating runas by calling it via a vbscript and having the vbscript pass across the admin password. I use an encoder to encode the vbscript so that the admin password can't be read by anyone. Drop me a line if you need a sample of the script. darthusr@hotmail.com

Collapse -

Batch FIle

by lkspecial In reply to Batch FIle

Poster rated this answer

Collapse -

Batch FIle

by lkspecial In reply to Batch FIle

This question was closed by the author

Back to Windows Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums