How to Prepare Desktop and Documents Before Enabling KFM in OneDrive for Business
🔍 WiseChecker

How to Prepare Desktop and Documents Before Enabling KFM in OneDrive for Business

Enabling Known Folder Move in OneDrive for Business redirects your Desktop and Documents folders to OneDrive. If you enable KFM without preparing those folders first, you can encounter sync errors, duplicate files, or broken shortcuts. This article explains exactly what to check and clean up in your Desktop and Documents folders before you turn on KFM. You will learn how to reduce file path length, handle special characters, and manage existing OneDrive shortcuts so the migration runs without interruptions.

Key Takeaways: Preparing Folders for a Smooth KFM Migration

  • File path length limit of 400 characters: Shorten deep folder structures and long file names to avoid sync errors after KFM is enabled.
  • Invalid characters in file and folder names: Remove or rename items containing characters like double quotes, colons, or asterisks that OneDrive cannot sync.
  • Existing OneDrive shortcuts in Desktop and Documents: Delete or move any .lnk files that point to OneDrive locations to prevent duplicate sync folders.

ADVERTISEMENT

What KFM Does and Why Preparation Matters

Known Folder Move is a OneDrive policy that redirects the Desktop, Documents, and Pictures folders from your local user profile to OneDrive. After KFM is enabled, all files you save to those folders are automatically synced to the cloud. The feature is commonly deployed by IT administrators through Group Policy or Intune, but individual users can also enable it in OneDrive settings.

The preparation step is often overlooked. When KFM runs, it copies the contents of your Desktop and Documents folders to the OneDrive sync location. If those folders contain files with unsupported characters, extremely long paths, or broken shortcuts, the sync process can stall or fail. In some cases, OneDrive creates a duplicate folder with a computer name suffix, leaving you with two copies of the same files.

Preparing the folders before KFM activation takes 10 to 15 minutes and prevents these failures. The three main areas to address are file path length, invalid characters, and existing OneDrive shortcuts.

Steps to Prepare Desktop and Documents for KFM

Follow these steps in the order listed. Complete all steps before you enable KFM in OneDrive settings.

  1. Check file path lengths in Desktop and Documents
    Open File Explorer and navigate to your Desktop folder. Press Ctrl + A to select all items, then right-click any selected item and choose Properties. Look at the Size and Contents summary. For a more precise check, use PowerShell: open PowerShell as administrator and run Get-ChildItem -Path $env:USERPROFILE\Desktop -Recurse | Where-Object { $_.FullName.Length -gt 260 }. Repeat for Documents by replacing Desktop with Documents. Any file or folder with a full path longer than 260 characters must be shortened. Move the item closer to the root of the folder, or rename it to a shorter name. The target maximum is 400 characters after KFM adds the OneDrive path prefix.
  2. Remove invalid characters from file and folder names
    OneDrive cannot sync files or folders whose names contain any of these characters: double quote (“), colon (:), backslash (\), forward slash (/), pipe (|), question mark (?), asterisk (), less than (<), or greater than (>). Scan your Desktop and Documents folders manually or use a tool like PowerShell: Get-ChildItem -Path $env:USERPROFILE\Desktop -Recurse | Where-Object { $_.Name -match '[\":\\/|?<>]' }. For each item found, rename it by removing or replacing the invalid character. A common example is a file named “Project Notes: Q1 2025.docx” — rename it to “Project Notes Q1 2025.docx”.
  3. Delete or move existing OneDrive shortcuts
    Shortcut files (.lnk) that point to OneDrive folders can cause confusion after KFM is enabled. Open your Desktop and Documents folders. Look for shortcuts with names like “OneDrive – Contoso” or “Shared Documents”. Right-click each shortcut and select Properties. In the Target field, check if the path contains “OneDrive” or a SharePoint URL. If it does, delete the shortcut or move it to a folder that is not redirected by KFM, such as Downloads.
  4. Back up critical files before migration
    Although KFM does not delete local files, a backup ensures you can recover if something goes wrong. Copy your Desktop and Documents folders to an external drive or a different cloud service. Alternatively, create a restore point in Windows: press Windows + R, type SystemPropertiesProtection, press Enter, select your system drive, and click Create. Name the restore point “Before KFM” and complete the wizard.
  5. Enable KFM in OneDrive settings
    Right-click the OneDrive cloud icon in the system tray and select Settings. Go to the Sync and backup tab. Under Backup your important PC folders, click Manage backup. Select the checkboxes for Desktop and Documents. Click Start backup. OneDrive will copy the folder contents and redirect the locations. This process can take several minutes depending on the amount of data.

ADVERTISEMENT

If KFM Still Has Issues After Preparation

OneDrive created a duplicate folder with a computer name suffix

This happens when OneDrive detects that the Desktop or Documents folder already contains a folder synced from OneDrive. The duplicate folder has a name like “Desktop – LAPTOP123”. To fix this, open the OneDrive folder in File Explorer. Move all files from the duplicate folder into the correct Desktop or Documents folder. Then delete the empty duplicate folder. Right-click the OneDrive icon, select Settings, go to the Sync and backup tab, and click Manage backup. Uncheck and recheck the affected folder to force a sync refresh.

OneDrive reports a sync error about a specific file

If a file still has a path longer than 400 characters or an invalid character that was missed during preparation, OneDrive will skip it and show a red X. Open the OneDrive sync status window by clicking the cloud icon and selecting View sync problems. Note the file path shown in the error message. Navigate to that file and rename it or move it to a shorter path. After the change, right-click the OneDrive icon and select Resume syncing.

Desktop icons or shortcuts disappeared after KFM

KFM moves the Desktop folder to the OneDrive location. Icons that were on the local Desktop are now in the OneDrive Desktop folder. If you do not see them, open File Explorer and navigate to the OneDrive folder. Open the Desktop folder inside it. If the icons are there, right-click each icon and select Send to > Desktop (create shortcut). This creates a shortcut on the new Desktop location. Alternatively, drag the icons from the OneDrive Desktop folder to the Desktop location shown in the Quick Access pane.

Desktop and Documents Before KFM vs After KFM: Key Differences

Item Before KFM After KFM
Folder location C:\Users\[username]\Desktop C:\Users\[username]\OneDrive – [tenant]\Desktop
File path prefix Short local path OneDrive folder path adds up to 100 characters
Sync behavior No sync unless files are manually copied to OneDrive Automatic sync to cloud on every save
Shortcut files (.lnk) Point to local or network locations Point to OneDrive locations after redirection
File name restrictions Windows allows most characters OneDrive blocks 9 invalid characters

Preparation reduces the risk of path length errors and duplicate folders. After KFM is active, your Desktop and Documents are always backed up to the cloud and accessible from other devices signed into the same OneDrive account.

If you manage multiple computers, use the OneDrive Group Policy setting “Set the maximum length for a file path” to enforce a 400-character limit before KFM is deployed. This policy is available in the OneDrive ADMX templates from Microsoft. Checking the path length before each migration prevents sync errors on the first sync.

ADVERTISEMENT