si lo he visto y me funciona correctamente si guardo archivos remotamente pero me falla al hacerlo localmente es decir al tratar de guardarlo en System32
Código vb:
Ver originalIf LogonUser("arellanomarketing", "ARELLANO", "arellano", LogonType.LOGON32_LOGON_NEW_CREDENTIALS, LogonProvider.LOGON32_PROVIDER_DEFAULT, admin_token) <> 0 Then
wid_admin = New WindowsIdentity(admin_token, "NTLM", WindowsAccountType.Normal, True)
System.Threading.Thread.CurrentPrincipal = New WindowsPrincipal(wid_admin)
wic = wid_admin.Impersonate()
System.IO.File.Copy("C:\ABC\ABC.sql", "\\SERVER\ABC\abc.sql") ' CORRECTO COPIA
System.IO.File.Copy("C:\ABC\ABC.sql","C:\Windows\System32\a.xml") ' DA ERROR
Else
MsgBox("NO ENTRO")
End If