View Full Version : VB e esecuzione automatica
visual_b
02-06-2004, 10:05
Come si fà a far partire un programma scritto in vb con l'avvio del computer senza metterlo nella cartella "menu avvio\programmi\esecuzione automatica"?
grazie
Dovresti guardare nel registro. Ora non ricordo esattamente dove ma da qualche parte cera da inserire una chiave con il nome del eseguibile e il processo da eseguire ad ogni avvio.
Un'altra soluzione potrebbe essere win.ini
ciao ;)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Il percorso è questo:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Ti passo una classe ed il modo per mettere appunto un eseguibile dentro il registro:
'scrivo nel registro lo start up
Call mcRegistry.RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
If chkAvviaStartUP = 1 Then
Call mcRegistry.RegSetStringValue(sAppName, App.Path & "\" & App.EXEName & ".exe")
Else
Call mcRegistry.RegDeleteValue(sAppName)
End If
Call mcRegistry.RegCloseKey
Se non hai mai gestito una classe, si fa così:
Option Explicit
Dim mcRegistry As clsRegistry
Private Sub Command1_Click()
'codice per inserire il tuo valore nel registro
End Sub
Private Sub Form_Load()
Set mcRegistry = New clsRegistry
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set mcRegistry = Nothing
End Sub
visual_b
02-06-2004, 12:59
Sono + che soddisfatto.
thanks all
vBulletin® v3.6.4, Copyright ©2000-2026, Jelsoft Enterprises Ltd.