Skip to content

update.bat: resolve the real Desktop for the icon tip (OneDrive redirect) - #3

Open
BigBeedle wants to merge 1 commit into
jaredrhod:mainfrom
BigBeedle:fix/onedrive-desktop-tip
Open

update.bat: resolve the real Desktop for the icon tip (OneDrive redirect)#3
BigBeedle wants to merge 1 commit into
jaredrhod:mainfrom
BigBeedle:fix/onedrive-desktop-tip

Conversation

@BigBeedle

Copy link
Copy Markdown

The problem

On Windows machines where OneDrive redirects the Desktop (very common on Windows 11 — the Desktop lives at %USERPROFILE%\OneDrive\Desktop), the end-of-update tip

Tip: want a desktop Update icon that does this on a double-click? Open your agent and ask for one.

fires even when the user is running the update from that very icon, because the check hardcodes %USERPROFILE%\Desktop.

The fix

Resolve the actual Desktop folder with [Environment]::GetFolderPath('Desktop') (which follows the OneDrive/Known Folder redirection), and fall back to the classic %USERPROFILE%\Desktop if the PowerShell query fails for any reason. No behavior change on non-redirected machines.

Tested on Windows 11 with a OneDrive-redirected Desktop and an Update <name>.bat icon present: full update run of all five repos, tip correctly suppressed.

🤖 Generated with Claude Code

…ect)

The "want a desktop Update icon?" tip checked %USERPROFILE%\Desktop, which
misses machines where OneDrive redirects the Desktop (the icon exists at
%USERPROFILE%\OneDrive\Desktop, so the tip fires even though the user is
running it from that very icon). Resolve the actual Desktop folder via
[Environment]::GetFolderPath('Desktop') and fall back to the classic path
if the query fails.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants