am12348 Posted November 16, 2013 Posted November 16, 2013 Hello to all, In the organization I'm working with, there are users, that don't have administrator's permissions. I was asked to write a batch that displays the task manager in any workstation. The command for displaying the task manager is relatively simple: taskmgr If the batch runs under an administrator user, the task manager is displayed. However if I try to run it under a non administrator user, a message concerning to permissions is displayed. My question is , if there is a way to impersonate the command in the batch, namely running the command as an administrator?Thank you in advance, Amos
MagicAndre1981 Posted November 17, 2013 Posted November 17, 2013 Have you tried runAs?http://www.windows-commandline.com/windows-runas-command-prompt/
am12348 Posted November 20, 2013 Author Posted November 20, 2013 MagicAndre1981, on 17 Nov 2013 - 08:56 AM, said:Have you tried runAs?http://www.windows-commandline.com/windows-runas-command-prompt/Hello, I've tried: runas /user:Administrator taskmgr.However I'm required to type the administrator's password. I need that the batch will be runautomatically without intervention. Namely I'mlooking for a way to store the administrator's password in the command/batch.Thank you,Amos
MagicAndre1981 Posted November 20, 2013 Posted November 20, 2013 you can pass the password to the RunAs exe
bphlpt Posted November 21, 2013 Posted November 21, 2013 Andre, I can't find any working example that shows passing the administrator password with the batch. I only found posts by folks that say they can't get it to work. Can you elaborate or provide a link? Thanks in advance.Cheers and Regards
MagicAndre1981 Posted November 21, 2013 Posted November 21, 2013 Use /savecred to save the password, so you only have to enter it once.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now