7

Here is my environment:

  • Windows 10 (also occurs with 8.1)
  • System partition C: is not encrypted using bitlocker
  • "Data" partition E: is encrypted using bitlocker with manual unlock
  • OneDrive desktop sync location: E:\OneDrive

When Windows starts, I manually unlock E: using my passphrase.

The problem

When my computer starts, OneDrive complains that my OneDrive sync location is not available. This is because the location is within a bitlocker-protected drive that is not yet unlocked.

We couldn't find the location of your OneDrive folder. Click OK to reconfigure your OneDrive folder.

We couldn't find the location of your OneDrive folder. Click OK to reconfigure your OneDrive folder.

[OK] [Close]

Whether I click OK or close, OneDrive deletes its own configuration and starts from scratch. "Hello, this is OneDrive, a place for all your files blah blah blah". I am forced to reconfigure the sync location and a very long sync operation starts.

sync operation

This has been reported on technet and on uservoice [1, 2]. The only answer people get is:

Encrypt your system partition and enable auto-unlock for your secondary partition. This way the partition will be unlocked before OneDrive starts.

OK but I do not want to encrypt the system partition. I want OneDrive to wait for my partition to be unlocked and then do its job.

Question

Do you know a way of delaying the startup of the OneDrive desktop app?
This would avoid the bug.

Do you know any other trick that would prevent the app from deleting its own configuration and state when this occurs?

3 Answers 3

6

This is how I solved this: So OneDrive in a secondary drive that has BitLocker enabled.

Problem is OneDrive should start and prompt for the drive to be unlocked, rather than crash and assume all needs to be set up again.

To fix you need to 1. Stop OneDrive from starting at boot + 2. Start OneDrive automatically when the drive is ready/unlocked.

  1. In OneDrive settings just untick the "Start OneDrive automatically when I sign in to Windows"

  2. Open "Task Scheduler"

  3. Click "Action" - "Create Task" (not basic)

  4. Change these settings (leaving the rest as defaults):

a) General tab

  • Name: Start OneDrive after BitLocker

b) Triggers tab - New...

  • Begin the task: On an event
  • Log: Microsoft-Windows-BitLocker-API/Management
  • Event ID: 782

c) Actions tab - New...

  • Action: Start a program
  • Program/script: powershell.exe
  • Add arguments: %USERPROFILE%\AppData\Local\Microsoft\OneDrive\OneDrive.exe /background

d) Conditions tab

  • Untick "Start the task only if the computer is on AC power"

    1. Done

So now OneDrive should not start after boot/logon and as soon as you unlock the encrypted drive OneDrive will start automatically.

5
  • Thanks. I will try. I'll give the result as soon as my computer boots up.
    – SandRock
    Commented Jul 18, 2017 at 8:58
  • It does not work :-/ The event does not trigger...
    – SandRock
    Commented Dec 4, 2017 at 20:15
  • It does for me, I am using Windows 10, here it is an screenshot: abadcer.com/wp-content/uploads/2017/12/bitlocker-event.png Commented Dec 7, 2017 at 4:56
  • Okay, in fact, it works. There is a delay of many minutes for the task to execute on my machine.
    – SandRock
    Commented Feb 2, 2019 at 15:44
  • In my case the arguments listed above (%USERPROFILE%\AppData\...) didn't worked. Instead the following argument worked: C:\'Program Files'\'Microsoft OneDrive'\OneDrive.exe /background Commented Jan 4, 2022 at 3:40
1

Update 2020. Updating @angel-abad-cerdeira solution as OneDrive.exe has changed location.

Note: You can double-check the exact command location to be added by looking at the registry key added in regedit HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run when activating 'Start OneDrive automatically when I sign in to Windows" option in OneDrive setting.

regedit

Update point c) in @angel-abad-cerdeira solution (points a, b and d stay the same):

  • remove powershell.exe
  • Use the environment variables %ProgramFiles(x86)% in place of C:\Program Files (x86) and use quotes

c) Actions tab - New...

  • Action: Start a program
  • Program/script: "%ProgramFiles(x86)%\Microsoft OneDrive\OneDrive.exe"
  • Add arguments: /background
0

You can prevent OneDrive from starting automatically. Open the task manager and disable OneDrive startup in the Startup tab.

disabled onedrive startup

Then when your drive is ready for use, start the OneDrive application.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .