Fix OneDrive Shortcuts After a Windows User Folder Change
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.
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.
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.
Open the Start menu, search for PowerShell, and select Windows PowerShell. Choose the folder containing the affected shortcuts before running the script.
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" } } }
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.
Create a Windows account with the original profile path
Consider this option if you prefer to use the original path rather than edit the shortcuts.
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.

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.




