diff --git a/CapsLockIndicatorV3/DownloadDialog.cs b/CapsLockIndicatorV3/DownloadDialog.cs index d55247e..b55889b 100644 --- a/CapsLockIndicatorV3/DownloadDialog.cs +++ b/CapsLockIndicatorV3/DownloadDialog.cs @@ -136,7 +136,7 @@ private void restartButton_Click(object sender, EventArgs e) if (runAtStarup) { RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true); - rk.SetValue("CapsLock Indicator", newPath); + rk.SetValue("CapsLock Indicator", $"\"{newPath}\""); } MainForm mainForm = Application.OpenForms.OfType().First(); diff --git a/CapsLockIndicatorV3/MainForm.cs b/CapsLockIndicatorV3/MainForm.cs index 1fe9a87..8d1043b 100644 --- a/CapsLockIndicatorV3/MainForm.cs +++ b/CapsLockIndicatorV3/MainForm.cs @@ -1206,7 +1206,7 @@ private void startonlogonCheckBox_CheckedChanged(object sender, EventArgs e) RegistryKey rk = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true); if (startonlogonCheckBox.Checked) - rk.SetValue("CapsLock Indicator", Application.ExecutablePath); + rk.SetValue("CapsLock Indicator", $"\"{Application.ExecutablePath}\""); else rk.DeleteValue("CapsLock Indicator", false); }