hiteshluthra Posted February 25, 2010 Share Posted February 25, 2010 Help needed with function send, basically i want to send ("#r") with admin rights,means to open run dialog box with admin previleges. RunAs($adminuser, $admindomain, $adminpass, 4, @SystemDir) Send("#r") But this code is not working with admin rights. Can u all genius help in this. Link to comment Share on other sites More sharing options...
jvanegmond Posted February 25, 2010 Share Posted February 25, 2010 Don't open a run box. Open elevated command prompt instead: RunAs($adminuser, $admindomain, $adminpass, 4, "cmd") github.com/jvanegmond Link to comment Share on other sites More sharing options...
hiteshluthra Posted February 25, 2010 Author Share Posted February 25, 2010 Thanks for the reply but i need that (run dialog box) to complete my script. help is appreciated Link to comment Share on other sites More sharing options...
jvanegmond Posted February 25, 2010 Share Posted February 25, 2010 But then run dialog box does nothing.. Why would you need it? github.com/jvanegmond Link to comment Share on other sites More sharing options...
hiteshluthra Posted February 25, 2010 Author Share Posted February 25, 2010 I need it because some commands does not work in cmd but works in Run dialog box, its just to provide ease to the user through script. And also curious to know wheather Function Send () can be used with admin right or not.And if yes then how. Help is appreciated. Link to comment Share on other sites More sharing options...
jvanegmond Posted February 25, 2010 Share Posted February 25, 2010 I need it because some commands does not work in cmd but works in Run dialog box, its just to provide ease to the user through script.Run uses shell execute while cmd uses run. To use shell execute from cmd, then type:start commandhereAnd also curious to know wheather Function Send () can be used with admin right or not.And if yes then how.It can't. And Google doesn't show any means at all of opening a run box with admin privileges through user interaction. github.com/jvanegmond Link to comment Share on other sites More sharing options...
hiteshluthra Posted February 25, 2010 Author Share Posted February 25, 2010 Thanks a lot for letting me know Link to comment Share on other sites More sharing options...
hiteshluthra Posted February 25, 2010 Author Share Posted February 25, 2010 This is my answer to my own question RunAs($adminuser, $admindomain, $adminpass, 4, 'c:\WINDOWS\system32\rundll32.exe shell32.dll,#61', @SystemDir) it is possible to open standard Run dialog window from command line c:\WINDOWS\system32\rundll32.exe shell32.dll`,#61 Thanks anyway for the help Link to comment Share on other sites More sharing options...
jvanegmond Posted February 25, 2010 Share Posted February 25, 2010 This is my answer to my own questionRunAs($adminuser, $admindomain, $adminpass, 4, 'c:\WINDOWS\system32\rundll32.exe shell32.dll,#61', @SystemDir)Thanks anyway for the helpVery nice! Wonder why I couldn't find this on Google ... github.com/jvanegmond Link to comment Share on other sites More sharing options...
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