Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Vista\Win7 - Is it possible to shell and specify an account to run the process under?

Vista\Win7 - Is it possible to shell and specify an account to run the process under?

Scheduled Pinned Locked Moved Visual Basic
questionlinuxannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jon_Boy
    wrote on last edited by
    #1

    Vista\Win7 - Is it possible to shell and specify an account to run the process under? Scenario: our company has a program that is a launcher app (kinda like a fancy version of click-once). Based on the arguements passed in, it determines what program the user is trying to run and what files need to be updated (controls, .dlls, etc), pulls them down from a shared directory and registers them (regsvr32 or regasm). After that process is done, the program that was requested is launched via shellex. In Vista and Win7 the regsvr32 and regasm functionality is broken because of UAC. The user has admin rights to only 1 folder in the Program Files directory (that is the location where the .dlls, etc are pulled down to). Is there a way to perform a shell (so that regsvr32 can be run) using a admin account (specifying user and password in code)?

    "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

    L 1 Reply Last reply
    0
    • J Jon_Boy

      Vista\Win7 - Is it possible to shell and specify an account to run the process under? Scenario: our company has a program that is a launcher app (kinda like a fancy version of click-once). Based on the arguements passed in, it determines what program the user is trying to run and what files need to be updated (controls, .dlls, etc), pulls them down from a shared directory and registers them (regsvr32 or regasm). After that process is done, the program that was requested is launched via shellex. In Vista and Win7 the regsvr32 and regasm functionality is broken because of UAC. The user has admin rights to only 1 folder in the Program Files directory (that is the location where the .dlls, etc are pulled down to). Is there a way to perform a shell (so that regsvr32 can be run) using a admin account (specifying user and password in code)?

      "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Try launching regsvr32 like this:

      System.Diagnostics.Process.Start("regsvr32.exe", username, password, domain);

      J 1 Reply Last reply
      0
      • L Lost User

        Try launching regsvr32 like this:

        System.Diagnostics.Process.Start("regsvr32.exe", username, password, domain);

        J Offline
        J Offline
        Jon_Boy
        wrote on last edited by
        #3

        I tried your suggestion but was unsuccessful.

        Process.Start("C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe", """" & "C:\Program Files\CompanyApp\System\dbDAL.dll" & _
        """" & " /codebase", "AdminAcct", pw, "Domain")

        The exit code = 100. Nothing errors off, but the assembly isn't registered correctly and can't be instantiated. If I run the SDK command prompt in adminstrative mode and run the same command and arguments, then the object and be instantiated correctly. Despite specifying the admin account, UAC appears to be blocking the registering. Sigh.

        "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

        M 1 Reply Last reply
        0
        • J Jon_Boy

          I tried your suggestion but was unsuccessful.

          Process.Start("C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe", """" & "C:\Program Files\CompanyApp\System\dbDAL.dll" & _
          """" & " /codebase", "AdminAcct", pw, "Domain")

          The exit code = 100. Nothing errors off, but the assembly isn't registered correctly and can't be instantiated. If I run the SDK command prompt in adminstrative mode and run the same command and arguments, then the object and be instantiated correctly. Despite specifying the admin account, UAC appears to be blocking the registering. Sigh.

          "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

          M Offline
          M Offline
          MicroVirus
          wrote on last edited by
          #4

          I was browsing around for this problem and found the following post (don't know if it's reliable): http://www.icodefactory.com/lab/post/UAC-Revealed-7e-elevation-of-rights-from-NET-as-commonly-misunderstood.aspx[^] I still think that even if this is true it should be possible to use the Windows API to somehow elevate the process, but I am not sure.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups