Kann ich eine Konsolenanwendung vom Windows-Dienst in Visual Studio c# auslösen? [geschlossen]
Posted: 03 Jan 2025, 04:17
Ich möchte die Konsolen-App aus dem Windows-Dienstprojekt auslösen
es funktioniert nicht
Code: Select all
// Set up the ProcessStartInfo
ProcessStartInfo startInfo = new ProcessStartInfo()
{
FileName = consoleAppPath, // Use cmd.exe to execute the console app
Arguments ="", // /K keeps the window open after the command is executed
CreateNoWindow = true, // Make sure the command window is visible
UseShellExecute = false // Execute via the system shell to allow interaction
};
Process process = Process.Start(startInfo);