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
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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMh8i2QzkHNdE3MkKfcaT6