natxnek
natxnek
CC#
Created by natxnek on 7/12/2024 in #help
autorun not working?
it shows up in the startup tab in the task manager but i can't open the file's location, it doesn't start on startup
var currentAssembly = System.AppContext.BaseDirectory;

string sourceFile = Path.Combine(currentAssembly, System.Environment.ProcessPath);
//Console.WriteLine(sourceFile);
string destPath = string.Format(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\zeusBOT" + "zeus.exe");
File.Copy(sourceFile, destPath, true);

RegistryKey reg = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
reg.SetValue("zeus", destPath.ToString() + " %bot");

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = System.Environment.ProcessPath;
process.StartInfo.Arguments = "-bot";
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
process.StartInfo.UseShellExecute = true;
process.Start();
process.WaitForExit();
var currentAssembly = System.AppContext.BaseDirectory;

string sourceFile = Path.Combine(currentAssembly, System.Environment.ProcessPath);
//Console.WriteLine(sourceFile);
string destPath = string.Format(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\zeusBOT" + "zeus.exe");
File.Copy(sourceFile, destPath, true);

RegistryKey reg = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
reg.SetValue("zeus", destPath.ToString() + " %bot");

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = System.Environment.ProcessPath;
process.StartInfo.Arguments = "-bot";
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
process.StartInfo.UseShellExecute = true;
process.Start();
process.WaitForExit();
6 replies
CC#
Created by natxnek on 6/28/2024 in #help
Thread when starting a process
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "discordbotloader.exe";
process.StartInfo.Arguments = "-bot";
process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
process.Start();
process.WaitForExit();
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "discordbotloader.exe";
process.StartInfo.Arguments = "-bot";
process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
process.Start();
process.WaitForExit();
is there a way to make that process run in the background when i close the application that started the process? if i close the main console app, it also closes the new process
9 replies