diff --git a/agent-cs/Services/RtcService.cs b/agent-cs/Services/RtcService.cs index d024faf..5a18ae4 100644 --- a/agent-cs/Services/RtcService.cs +++ b/agent-cs/Services/RtcService.cs @@ -160,7 +160,7 @@ public class RtcService AgentWorker.Log("RDP: Frame-Loop beendet"); } - private static bool SpawnCaptureHelper(string exePath, string pipeName) + private static bool SpawnCaptureHelper(string exePath, string portStr) { try { @@ -171,7 +171,7 @@ public class RtcService return false; } - var taskName = $"ITNexus-RDP-{pipeName[^8..]}"; + var taskName = $"ITNexus-RDP-{portStr}"; Process.Start(new ProcessStartInfo("schtasks.exe", $"/delete /tn \"{taskName}\" /f") { CreateNoWindow = true })?.WaitForExit(); @@ -181,7 +181,7 @@ public class RtcService ? "/ru \"INTERACTIVE\"" : $"/ru \"{fullUser}\""; - var args = $"/create /tn \"{taskName}\" /tr \"\\\"{exePath}\\\" --rdp-capture {pipeName}\" " + + var args = $"/create /tn \"{taskName}\" /tr \"\\\"{exePath}\\\" --rdp-capture {portStr}\" " + $"/sc ONCE /st {triggerTime} {ruArg} /it /f"; var p = Process.Start(new ProcessStartInfo("schtasks.exe", args)