Shutdown OneDrive Service Using Batch File
This article provides a step-by-step guide on how to create a batch file that shuts down the OneDrive service. The batch file is created by ordering the shutdown of the OneDrive service using the OneDrive.exe executable file.
Prerequisites
Before creating the batch file, ensure the following:
- You have administrative privileges on the system.
- The OneDrive service is running.
Creating the Batch File
To create the batch file, follow these steps:
- Open Notepad or any text editor.
- Type the following command in the text editor:
whoami
"C:\Program Files\Microsoft OneDrive\OneDrive.exe" /shutdown
Saving the Batch File
After entering the command, save the file with a .bat extension, for example, "OneDriveShutdown.bat". Make sure to save the file in a location that is easily accessible, such as the Desktop.
Double-clicking the Batch File
To execute the batch file, simply double-click it. The OneDrive service will be shut down.
Troubleshooting
If you encounter any issues, make sure the OneDrive service is running before executing the batch file. If the problem persists, consult the OneDrive support resources.
References
- Microsoft OneDrive: OneDrive for Business FAQ
- Batch Files: Batch Script Quick Guide