Results 1 to 12 of 12

Thread: Run As Different User

Threaded View

  1. #1

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Run As Different User

    Hi,

    I would like to run my program as different user. Let's say I have following code which will open Run dialog:
    VB Code:
    1. Private Declare Function SHRunDialog Lib "shell32" Alias "#61" (ByVal hwnd As Long, ByVal I_dont_know_1 As Long, ByVal I_dont_know_2 As Long, ByVal dTitle As String, ByVal dPrompt As String, ByVal uFlags As Long) As Long
    2.  
    3. Private Sub Form_Load()
    4.     SHRunDialog hwnd, 0, 0, "", "", 2
    5.     Unload Me
    6. End Sub
    If we double click the executable of this program it will run in current windows user. I want to run this with different user. To do that normally we right click on exe file and click run as. Then we will enter the user name and password.

    I would like to automate this process some how.

    Thanks in advance.
    Attached Images Attached Images  
    CS

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