Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Grant Administrator access to a Process?

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2003
    Location
    Australia
    Posts
    252

    Resolved [RESOLVED] [2005] Grant Administrator access to a Process?

    Hi All,

    Inspired by http://www.vbforums.com/showthread.php?t=420404, I was wondering if there is a way to grant Administrator access to a Process?

    I have the following code:

    VB Code:
    1. Dim p As New Process
    2.             Dim psi As New ProcessStartInfo("defrag.exe")
    3.             psi.Arguments = drv
    4.             p.StartInfo = psi
    5.             p.Start()
    6.             p.WaitForExit()

    The problem is defrag.exe cannot be run under Limited User.

    Therefore as a workaround, I have

    VB Code:
    1. btnDefrag.Enabled = My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator)
    in Form Load.

    It would be great if I could make the Form prompt for Administrator user/pass to start the process. Am I imagining things or is this possible in .NET?

    Thanks guys!
    McoreD
    Last edited by ~*McoreD*~; Aug 6th, 2006 at 01:13 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width