From: Max Vilimpoc Date: Sat, 29 Aug 2026 17:17:40 +0000 (+0200) Subject: dotfiles: stop the UAC launch line mangling its own arguments X-Git-Url: https://vilimpoc.org/repos/dotfiles/commitdiff_plain/422ce8c735062050411d37ea8958eb3f71a42eea?ds=sidebyside;hp=422ce8c735062050411d37ea8958eb3f71a42eea dotfiles: stop the UAC launch line mangling its own arguments Adding -TraceUser to the elevated launch gave it a second quoted argument, and the "".."" doubling used to get quotes through cmd only survives ONE. With two, the quote-state parsing merges the tail into the -File value, so the elevated PowerShell was handed -File "C:\...\setup-windows-with-uac.ps1 -TraceUser LATISLAB\Claude " and refused it -- "failed because the file does not have a '.ps1' extension" -- exiting -196608 (0xFFFD0000) before Start-Transcript could run. The batch file then reported no elevated log and guessed at a cancelled UAC prompt, which is the one thing that had not happened. Both values now travel in the environment and the quotes the child needs are built as [char]34 inside PowerShell, so the command line in the batch file carries no quote characters of its own beyond the outer pair. Exercised through cmd against a probe script in a directory with a space in its name: -File binds, -TraceUser arrives as LATISLAB\Claude, and the child's exit code still propagates. Against the real script with -Verb RunAs dropped, it now gets as far as the #Requires elevation check, which is where a non-elevated run should stop. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01YMh8i2QzkHNdE3MkKfcaT6 ---