Sign in to follow this  
Followers 0
CrouchingHippo

Calling msc via admin account

3 posts in this topic

Hi All newbie needing dunce cap here

I 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 with

ShellExecute("diskmgmt.msc")

and called it disk.exe and it works correctly.

So applying no knowledge at all I tried

Local $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 advance

CH

Share this post


Link to post
Share on other sites



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 :D

Bye,

Tim

Share this post


Link to post
Share on other sites

Dude thanks

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0