I would like to run my program as different user. Let's say I have following code which will open Run dialog:
VB Code:
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
Private Sub Form_Load()
SHRunDialog hwnd, 0, 0, "", "", 2
Unload Me
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.
Import? Is this a VBA project you are talking about? For VBA7 compatibility all API declares has to be first converted to the new x86+x64 compatible format.
This is a vb solution/project (visual studio) doing something very simple, but since I don't always having the rights to a network drive I need, I wanted to try to run the vb executable as a different user.
This is a vb solution/project (visual studio) doing something very simple, but since I don't always having the rights to a network drive I need, I wanted to try to run the vb executable as a different user.
Then you are using VB.Net, the given sample is for VB6