OneDrive File Issues

Fix OneDrive Shortcuts After a Windows User Folder Change

Olivia MillerOlivia Miller Nov 14, 2026 868 views

Question details

Repair shortcut files that reference an old Windows user-folder path after a move to a new computer.

Product
Microsoft OneDrive and Windows
Device & OS
Windows; version not provided
Scenario
Hundreds of LNK files were moved to a computer where the Windows profile folder has a different name.
Observed behavior
The shortcuts point to C:\Users\Ian, but the new profile uses C:\Users\Ianxx.
Before you start

Right-click a few affected shortcuts, select Properties, and check their Target paths. In File Explorer, confirm the corresponding files exist under the new profile and note the exact OneDrive folder name.

Solution 1Recommended

Update shortcut targets in bulk with PowerShell

Use this method to keep the current Windows profile and replace the old path in matching LNK targets.

The script searches a folder you choose and its subfolders. It changes only shortcut targets that start with C:\Users\Ian and skips replacements whose new target cannot be found.

1
Open PowerShell

Open the Start menu, search for PowerShell, and select Windows PowerShell. Choose the folder containing the affected shortcuts before running the script.

2
Preview the changes

Paste the script below into PowerShell. Replace the $root value with the actual folder containing the shortcuts, then press Enter. Leave $apply set to $false to preview changes without saving them. $root = 'C:\Users\Ianxx\OneDrive\Shortcuts' $old = 'C:\Users\Ian' $new = 'C:\Users\Ianxx' $apply = $false $shell = New-Object -ComObject WScript.Shell Get-ChildItem -LiteralPath $root -Filter '*.lnk' -File -Recurse | ForEach-Object { $link = $shell.CreateShortcut($_.FullName) $target = $link.TargetPath if ($target -and ($target -ieq $old -or $target.StartsWith($old + '\', [StringComparison]::OrdinalIgnoreCase))) { $newTarget = $new + $target.Substring($old.Length) if (Test-Path -LiteralPath $newTarget) { Write-Host "UPDATE: $($_.FullName) -> $newTarget" if ($apply) { $link.TargetPath = $newTarget; $link.Save() } } else { Write-Host "SKIP: $($_.FullName) -> $newTarget not found" } } }

3
Apply and test

Review the UPDATE and SKIP lines. If the proposed paths are correct, run the script again with $apply = $true, then open several updated shortcuts in File Explorer.

Check other shortcut properties: This script updates the Target field only. If a shortcut also has an old path in its Start in field, arguments, or custom icon location, review those properties separately. Changes inside a synced OneDrive folder can sync to other devices.
Free Microsoft Office alternative

Work with Office files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility, making it easy to move your document work to a new computer. It does not repair Windows shortcut targets or OneDrive sync paths.

Open documents, spreadsheets, and presentations after moving to a new computerCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXFamiliar editing interface for a smooth transition from Microsoft OfficeFree and lightweight suite for everyday office work
microsoft office alternative - wps office

Frequently Asked Questions

Why do my OneDrive shortcuts still point to the old computer's user folder?

Windows LNK files can store absolute paths such as C:\Users\Ian\OneDrive. Moving or syncing the shortcut does not automatically replace that path with the new profile path.

How can I check where a broken shortcut points?

In File Explorer, right-click the shortcut, select Properties, and look at the Target field on the Shortcut tab. Also check Start in if the shortcut still fails after its target is corrected.

Will creating an account named Ian always restore C:\Users\Ian?

No. Windows may create a different profile-folder name if the desired path is already in use. Sign in to the new account and check the actual folder under C:\Users before relying on it.

Why did the PowerShell script skip some shortcuts?

The script skips a matching shortcut when the proposed new target cannot be found. Check the SKIP line, confirm the file exists, and compare the OneDrive folder name and the rest of the path with the shortcut's Target.