Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load txtPath.Text = Application.ExecutablePath.ToString End Sub Private Sub btnWrite_Click(sender As Object, e As EventArgs) Handles btnWrite.Click Try Dim regKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True) regKey.SetValue(IO.Path.GetFileNameWithoutExtension(txtPath.Text), txtPath.Text) regKey.Close() MsgBox("Write Complete!") Catch ex As Exception MsgBox(ex.ToString) End Try End Sub End Class