CrouchingHippo Posted August 29, 2009 Share Posted August 29, 2009 Hi All newbie needing dunce cap hereI have been trying to run diskmgmt.msc via a local admin account,so that non admins can do some disk stuff.I couldn't get "msc" called, using ShellExecute within the file,Local $sUserName = "adm_local"Local $sPassword = "123"local $sProgramm = ShellExecute("diskmgmt.msc")RunAs($sUserName, @ComputerName, $sPassword, 0, $sProgramm, @ComSpec)It didn't work.So I tried creating an exe file withShellExecute("diskmgmt.msc")and called it disk.exe and it works correctly.So applying no knowledge at all I triedLocal $sUserName = "adm_local"Local $sPassword = "123"local $sProgramm = ShellExecute("disk.exe")RunAs($sUserName, @ComputerName, $sPassword, 0, $sProgramm, @ComSpec)I have no output on the screen.(after copying disk.exe into system folder.)I know I must be doing it wrong so please be gentle.Thanks in advanceCH Link to comment Share on other sites More sharing options...
Talder Posted August 29, 2009 Share Posted August 29, 2009 Hi, Use it like this: Local $sUserName = "administrator" Local $sPassword = "blabla" local $sProgramm = "mmc diskmgmt.msc" RunAs($sUserName,@ComputerName,$sPassword,0,$sProgramm) Make sure your user has the right permission, otherwise you will see nothing happen Bye, Tim Link to comment Share on other sites More sharing options...
CrouchingHippo Posted August 29, 2009 Author Share Posted August 29, 2009 Dude thanks 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