Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runing a batch file with admin rights 1

Status
Not open for further replies.

bazcurtis

Technical User
Jul 11, 2001
134
0
0
GB
Hi,

I need my users to run an install batch file, but they need admin rights. How can I make a batch file run locally with admin rights?

Best wishes

Michael Curtis
 
Add the line RUNAS to the beginning of the batch. If you type in RUNAS alone from a command prompt, it will give you the syntax...

Thanks,

Matt Wray
MCSE, MCSA, MCP, CCNA

 
bazcurtis, did you get this to work? I might need to do the same thing so I'm curious if it worked out.
 
Unfortunately I didn't and Microsoft had no idea either!!!
 
Thanks for the update. Hopefully mattwrary will chime in with some info. Do you recall exactly what the problem was when you tried to use RUNAS?
 
1. You need to supply the username and credentials of an Administrator user with RUNAS. As this provides a plaintext security breach, you might use a wrapper application to hide this information: thread779-676827

2. Make certain there is no Group Policy preventing a logon as a batch process.

3. If you like, you can do this through Scheduled Tasks. One schedule option is 'at Logon.' You can put the Administrator name and password in the Logon section of the Scheduled Task. I use a 'temporary' Administrator account for just this purpose, and change the password frequently.

4. You can use Group Policy to publish the application and push the installation.

5. You can do the installation remotely. While there are resource kits that would permit this, I use the terrific utility PSEXEC from sysinternals: (freeware)
If the username/password used has Administrator rights, and there are no Policy restricting logon as a batch (or possibly service), any of these 5 methods will work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top