Skip to content

Commit 393d106

Browse files
committed
Fix command line pass issue
1 parent 61717dc commit 393d106

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Flow.Launcher.Infrastructure/Win32Helper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,9 @@ public static unsafe bool RunAsDesktopUser(string app, string currentDir, string
911911

912912
// 7. Start the new process with that primary token
913913
fixed (char* appPtr = app)
914-
fixed (char* cmdLinePtr = cmdLine)
914+
// Because argv[0] is the module name, C programmers generally repeat the module name as the first token in the command line
915+
// So we add one more dash before the command line to make command line work correctly
916+
fixed (char* cmdLinePtr = $"- {cmdLine}")
915917
fixed (char* currentDirPtr = currentDir)
916918
{
917919
if (!PInvoke.CreateProcessWithToken(hPrimaryToken,

0 commit comments

Comments
 (0)