Grazie ancora per la tua pazienza ma il problema persiste.
questo e' il codice associato ad un command_button che funziona cottettamente se srivo in HKEY_CURRENT_USER,
ma mi serve di scrivere la stessa chiave anche in
HKEY_LOCAL_MACHINE ma non mi funziona e non capisco il motivo.
Private Sub Command1_Click()
Dim leggi As String
Set wsh = CreateObject("WScript.Shell")
cartella = CurDir
wsh.RegWrite "HKEY_CURRENT_USER\mioprogetto\PATH\Path", cartella
leggi = wsh.RegRead("HKEY_CURRENT_USER\mioprogetto\PATH\Pa th")
MsgBox "Hai appena scritto:" & leggi
End Sub
lo stesso codice ma in HKEY_LOCAL_MACHINE :
Private Sub Command1_Click()
Dim leggi As String
Set wsh = CreateObject("WScript.Shell")
cartella = CurDir
wsh.RegWrite "HKEY_LOCAL_MACHINE\mioprogetto\PATH\Path", cartella
leggi = wsh.RegRead("HKEY_LOCAL_MACHINE\mioprogetto\PATH\P ath")
MsgBox "Hai appena scritto:" & leggi
End Sub
mi segnala ques'errore:
Errore di Runtime .xxxxxxxxxxxx
Radice non valida nella chiave del Registro di Sistema:
"HKEY_LOCAL_MACHINE\mioprogetto\PATH\Path".
SIGHHHH![]()

Rispondi quotando