8

I would like to know how to pause onedrive from syncing using a command in the cmd. I am doing this because I have my .minecraft folder shared in onedrive and when I am playing minecraft, it is really slow and onedrive tries to sync the data that is being used. Right now I have to pause it with right clicking the folder and clicking pause but I would like to know the code to stop it with cmd so I can made a .bat file to pause onedrive and then start minecraft. If anyone knows how to do this, please let me know.

Thanks, Kyle5953c

5 Answers5

5

A more graceful way to stop OneDrive than TASKILL or PSSUSPEND is:

%LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe /shutdown
4

You can stop it by running a batch file that will loop so it will stop onedrive until you exit:

:Loop
Taskkill /f /im onedrive.exe
Goto loop

If you want to do it manually, then simply just do Taskkill /f /im onedrive.exe

Please run this batch file once you have started minecraft. Tested on Windows 7

Roke
  • 1,052
3

I had the same problem, and I solved it as follows: Suspend (shutdown) Onedrive:

"%LOCALAPPDATA%\Microsoft\OneDrive\onedrive" /shutdown

Resume Onedrive:

start "OneDrive" /B "%LOCALAPPDATA%\Microsoft\OneDrive\onedrive" /background

Without the start command, Onedrive becomes a subtask of your batch command, and it never comes back. /background suppresses user prompts

Toto
  • 19,304
1

Use pssuspend https://technet.microsoft.com/en-us/sysinternals/pssuspend

pssuspend onedrive minecraft pssuspend -r onedrive

Max
  • 318
0

I know you asked for cmd.exe, but I wrote a PowerShell script that restarts OneDrive and you may find it useful since it also contains logic to stop OneDrive. You can invoke it from cmd.exe as:

PowerShell.exe -File path\to\Restart-OneDrive.ps1 -NoProfile -ExecutionPolicy Bypass
felipecrs
  • 542
  • 5
  • 5