BALR1415 Posted October 9, 2008 Posted October 9, 2008 I have users that need to run ipconfig to release and/or renew and lack authority in XP. What I think I want to do is create a special local user that can change Network Configuration, then create an Autoit script which runs Shellexecute as this user to do the ipconfig commands - then compile the script to create an executable to hide any user and password that may be in the script. How to I set the authority to the special local user? The Shellexecute part looks easy but I am unsure how I do it as a "RnunAs".
anom1234 Posted October 9, 2008 Posted October 9, 2008 I mean "Run As"Hi! In command prompt type:>runas /user:administrator "mmc gpedit.msc"That example would open up group policy editor. Anything with a .msc extension needs mmc in front of it to work. exe's (such as cmd.exe) don't need mmc in front of it. Quotes are also important.Cheers!
anom1234 Posted October 9, 2008 Posted October 9, 2008 I mean "Run As"Hi! In command prompt type:>runas /user:administrator "mmc gpedit.msc"That example would open up group policy editor. Anything with a .msc extension needs mmc in front of it to work. exe's (such as cmd.exe) don't need mmc in front of it. Quotes are also important.Cheers!
BALR1415 Posted October 11, 2008 Author Posted October 11, 2008 Hi! In command prompt type:>runas /user:administrator "mmc gpedit.msc"That example would open up group policy editor. Anything with a .msc extension needs mmc in front of it to work. exe's (such as cmd.exe) don't need mmc in front of it. Quotes are also important.Cheers!What I rreally want to do is imbed the "runas" in the script so regular users cannot see that it is a special user.
lostangel556 Posted October 11, 2008 Posted October 11, 2008 (edited) What I rreally want to do is imbed the "runas" in the script so regular users cannot see that it is a special user.You could use the below script to do what you want. I've used something similar before on my Silent LogMeIn Free script.CODE$Username = $Domain = ; You can put @LogonDomain here if domain users or if using an system account use @ComputerName$Password = RunAsWait($Username ,$Domain ,$Password , 2, "cmd.exe /c ipconfig /release", @SystemDir, @SW_HIDE)RunAsWait($Username ,$Domain ,$Password , 2, "cmd.exe /c ipconfig /renew", @SystemDir, @SW_HIDE)The above script will run an renew on thier ip address with all the command prompt boxes hidden Edited October 11, 2008 by lostangel556
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