Dim PassWord As New Security.SecureString Dim c As Char, str As String = "123456" For Each c In str PassWord.AppendChar(c) Next c System.Diagnostics.Process.Start ("\\serveur\partage\dossier\sousdossier\fichier.ext","","AyantDroit",PassWord,"domaine")
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDeclare Function LogonUser Lib "ADVAPI32.dll" Alias "LogonUserA" ( _ ByVal lpszUsername As String, _ ByVal lpszDomain As String, _ ByVal lpszPassword As String, _ ByVal dwLogonType As Long, _ ByVal dwLogonProvider As Long, _ ByRef phToken As Long) As Long Declare Function CreateProcessAsUser Lib "kernel32.dll" Alias "CreateProcessAsUserA" ( _ ByVal hToken As Long, _ ByVal lpApplicationName As String, _ ByVal lpCommandLine As String, _ ByVal lpProcessAttributes As SECURITY_ATTRIBUTES, _ ByVal lpThreadAttributes As SECURITY_ATTRIBUTES, _ ByVal bInheritHandles As Long, _ ByVal dwCreationFlags As Long, _ ByVal lpEnvironment As String, _ ByVal lpCurrentDirectory As String, _ ByVal lpStartupInfo As STARTUPINFO, _ ByVal lpProcessInformation As PROCESS_INFORMATION) As Long Declare Function CloseHandle Lib "kernel32.dll" ( _ ByVal hObject As Long) As Long
System.Diagnostics.Process.Start ("%windir%\notepad.exe","c:\tonfichier.txt","AyantDroit","motdepasse_secret","")