Jump to content

Calling msc via admin account


Recommended Posts

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...