Skip to content

Fix FreeRDP /app:cmd quote parsing breaking batch script execution#927

Open
bcrtvkcs wants to merge 1 commit into
winapps-org:mainfrom
bcrtvkcs:main
Open

Fix FreeRDP /app:cmd quote parsing breaking batch script execution#927
bcrtvkcs wants to merge 1 commit into
winapps-org:mainfrom
bcrtvkcs:main

Conversation

@bcrtvkcs
Copy link
Copy Markdown

@bcrtvkcs bcrtvkcs commented May 12, 2026

Problem

During installation, WinApps runs a batch script on Windows via FreeRDP's /app:cmd argument to scan for installed applications. The scan consistently failed with APP_SCAN_TIMEOUT regardless of the timeout value set.

Debugging revealed the following error in the FreeRDP log:

[ERROR][com.winpr.commandline] - [get_next_comma]: Invalid quoted argument

The root cause is the extra quotes surrounding $BATCH_SCRIPT_PATH_WIN in the FreeRDP command:

/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C "$BATCH_SCRIPT_PATH_WIN""

FreeRDP's /app:cmd parser interprets the inner quotes as a malformed argument, causing the command to be passed to Windows incorrectly. As a result, the batch script never executes, installed.tmp is never created, and the installation times out waiting for installed to appear.

Fix

Remove the quotes surrounding $BATCH_SCRIPT_PATH_WIN:

Before:

/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C "$BATCH_SCRIPT_PATH_WIN"" \

After:

/app:program:"C:\Windows\System32\cmd.exe",cmd:"/C $BATCH_SCRIPT_PATH_WIN" \

$BATCH_SCRIPT_PATH_WIN expands to a UNC path without spaces (\\tsclient\home\.local\share\winapps\installed.bat), so the quotes around the variable and the trailing empty "" are not needed. These extra quotes caused FreeRDP's /app:cmd parser to fail with "Invalid quoted argument", preventing the batch script from executing.

AI Assistance Disclosure

Claude Sonnet 4.6 was used to assist in debugging and identifying the root cause. The fix itself is a single-character change that was verified manually.

Tested On

  • FreeRDP 3.26.0
  • Windows 11 (Docker/dockur)
  • CachyOS

The extra quotes around \$BATCH_SCRIPT_PATH_WIN caused FreeRDP's /app:cmd argument parser to fail with 'Invalid quoted argument', preventing the batch script from running on Windows. Removing the surrounding quotes fixes the issue.

Signed-off-by: K. Cihan Sipahi <32391714+bcrtvkcs@users.noreply.github.com>
@oskardotglobal oskardotglobal added the ai-assisted Created using assistance of LLMs label May 12, 2026
@oskardotglobal
Copy link
Copy Markdown
Member

Your fix is invalid. You only removed one double quote instead of two.

@bcrtvkcs
Copy link
Copy Markdown
Author

Your fix is invalid. You only removed one double quote instead of two.

But it works.

@oskardotglobal
Copy link
Copy Markdown
Member

The PR description literally contradicts the file change.

@bcrtvkcs
Copy link
Copy Markdown
Author

The PR description literally contradicts the file change.

Yes. You're absolutely right. I removed two double quotes, not one. Updated the description to reflect the actual change. Thanks for catching that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Created using assistance of LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants