Forum Discussion

MicrosoftChallenged's avatar
MicrosoftChallenged
Copper Contributor
Aug 19, 2025

OneDrive folders when switching to a new computer

Hi All

Let me first explain what I have setup

  1. I have created my OneDrive on my computer to sync only selected folders to my SD card.  (Many reasons and I have found this very useful)  I customized the OneDrive location using this article https://support.microsoft.com/en-us/office/install-onedrive-on-an-external-drive-6307e24b-d7a4-493f-bf43-47345b2c11fe
  2. I now have a new computer and will be just moving this SD card over and all my data should be there and ready to go.  
  3. I have only selected some of the OneDrive folders to sync and of them some of it is made locally available so I can work on them even if I am off line (like traveling on a plane with no internet) or am in the woods or very remote locations where I get no connectivity.

Now to the question 

  1. I plan to setup my new computer with the SD card and hopefully can follow the article (https://support.microsoft.com/en-us/office/install-onedrive-on-an-external-drive-6307e24b-d7a4-493f-bf43-47345b2c11fe) and once more link up the SD card (with all the information it has locally)
  2. Where does Windows 10/OneDrive store information about which are the folder I have selected and what to do with them?  I cannot find this information and maybe I do not need it - unsure about this.
  3. If I do as stated in article https://support.microsoft.com/en-us/office/install-onedrive-on-an-external-drive-6307e24b-d7a4-493f-bf43-47345b2c11fe with the old SD card in my new computer will I be up and running or is there something I should follow to make this work well.  Remember I cannot have the SD card in two locations to know the information.
  4. Any guidance or pointers from any one who has done this would be very helpful.

I wish MS helps people who want to customize or adapt things by giving more clear instruction on how they design or document so people can customize.  I struggle with this and how MS does their software.
While on OneDrive - anyone written batch files on the computer to create onedrive folders, then share it with users along with setting expiration dates?  These can be done on the browser, but one folder at a time with clickoholic interface and it gets repetitive very quickly if you have to do this for 40 students every semester - Of course MS has not way of doing this at all (at least to my knowledge and my reading) 

1 Reply

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    Where OneDrive stores “which folders are synced”

    • The list of selected folders (from “Choose folders” in OneDrive Settings) is not stored on the SD card itself.
    • It’s stored in your Windows user profile in the registry and config files, tied to that computer.
    • Specifically, OneDrive keeps:
      • Registry keys under

    HKEY_CURRENT_USER\Software\Microsoft\OneDrive

      • Config files in

    %localappdata%\Microsoft\OneDrive\settings

     

    These settings are not stored on OneDrive cloud or the external drive itself. They are local configurations that tell your computer which folders to sync.

    This means when you move the SD card to a new computer, OneDrive does not automatically know which folders were selected to sync before.

     

    What happens when moving the SD card and setting up a new computer?

    • When you move the SD card:
      • The actual files and folders are on the SD card.
      • The local sync settings are stored on your new computer's user profile.
    • If you install OneDrive and point it to the SD card location (per the article), OneDrive will attempt to sync based on your current settings.

     

    Will the setup work if you do as in the article?

    • Yes, if you:
      • Install OneDrive on the new computer.
      • Sign in with your account.
      • During setup, select the same folder location on your SD card (matching the previous path).
      • Choose the same folders to sync (or "Sync all" if desired).
    • However, the previous sync settings (which folders are selected) are not automatically restored from the old computer unless you manually:
      • Reconfigure the sync settings in the new OneDrive app.
      • Or, copy the configuration files from the old computer's profile (if you have access), which is not officially supported and may cause issues.

     

     Best approach to ensure a smooth transition:

    • On your old computer:
      • Before moving, note which folders are selected for sync.
      • You can use OneDrive's Settings > Account > Choose folders to see and document this list.
    • On your new computer:
      • Install OneDrive.
      • Set the local folder to the same SD card location.
      • Sign in.
      • When prompted to select folders to sync, select the same folders as before.
      • Let OneDrive run a full sync check (can take a while).
      • Ensure that the folder structure matches; otherwise, OneDrive may create duplicates or errors.
    • Important:
      • You must not connect the SD card to two computers simultaneously** with the same OneDrive account, as this can cause conflicts.
      • If you want to avoid re-syncing everything, consider pausing sync initially, then adjusting folder selections.

     

    Regarding batch scripts for folder creation and sharing

    • Creating folders via script:
      • Yes, you can use batch files or PowerShell scripts to automate folder creation.
    • Sharing folders with expiration:
      • This cannot be done directly via batch scripts.
      • You must use OneDrive's web interface or Microsoft Graph API for automation:
        • Microsoft Graph API allows programmatic sharing, including setting expiration dates.
        • This approach requires scripting with PowerShell, Python, or other languages using REST API.
    • PowerShell + Graph API example:
      • You can write scripts to:
        • Create folders.
        • Share with users.
        • Set expiration dates on sharing links.
    • Third-party tools:
      • Some third-party tools or scripts exist that automate sharing, but Microsoft Graph API is the most flexible and supported.

     

    At the End…

    Your old SD card trick will still work on the new computer, but you must reselect the sync folders manually — Windows does not carry that config.

    For batch folder creation + sharing, PowerShell + Graph API is the way to go — it avoids “clickoholism.”

     

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

     

    Was the answer useful? Mark as best response and like it!

    This will help all forum participants.

Resources