Ver Mensaje Individual
  #3 (permalink)  
Antiguo 02/02/2011, 13:38
Avatar de Dradi7
Dradi7
 
Fecha de Ingreso: junio-2008
Ubicación: Peru - Lima
Mensajes: 1.518
Antigüedad: 15 años, 11 meses
Puntos: 220
Respuesta: Guardar archivos en System32

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 original
  1. If LogonUser("arellanomarketing", "ARELLANO", "arellano", LogonType.LOGON32_LOGON_NEW_CREDENTIALS, LogonProvider.LOGON32_PROVIDER_DEFAULT, admin_token) <> 0 Then
  2.                 wid_admin = New WindowsIdentity(admin_token, "NTLM", WindowsAccountType.Normal, True)
  3.                 System.Threading.Thread.CurrentPrincipal = New WindowsPrincipal(wid_admin)
  4.                 wic = wid_admin.Impersonate()
  5.                 System.IO.File.Copy("C:\ABC\ABC.sql", "\\SERVER\ABC\abc.sql") ' CORRECTO COPIA
  6.                System.IO.File.Copy("C:\ABC\ABC.sql","C:\Windows\System32\a.xml") ' DA ERROR
  7.            Else
  8.                 MsgBox("NO ENTRO")
  9.             End If
__________________
La clave de todo triunfador es eliminar todas sus excusas y sus limitaciones