public AutostartManager(string name, string path, string arguments, AutostartType type) { this.name = name; this.path = path; this.arguments = arguments; switch (type) { case AutostartType.CurrentUser: runKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run"); break; case AutostartType.LocalMachine: runKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run"); break; } }