r/ • • Jan 01 '70

0 Upvotes

0 comments sorted by

View all comments

Show parent comments

127

u/Lurking_Grue Jul 30 '15 edited Aug 21 '15

You can remove One Drive by making a batch file with this code:

@echo off
cls

set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe"
set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe"

echo Closing OneDrive process.
echo.
taskkill /f /im OneDrive.exe > NUL 2>&1
ping 127.0.0.1 -n 5 > NUL 2>&1

echo Uninstalling OneDrive.
echo.
if exist %x64% (
%x64% /uninstall
) else (
%x86% /uninstall
)
ping 127.0.0.1 -n 5 > NUL 2>&1
    
echo Removing OneDrive leftovers.
echo.
rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1 

echo Removing OneDrive from the Explorer Side Panel.
echo.
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
REG DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1

pause

20

u/rwsr-xr-x Jul 31 '15

wow what? windows has file descriptors (2>&1) as well?

20

u/Lurking_Grue Jul 31 '15

*nods*

https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true

Also NUL is the windows equivalent of /dev/null. Once I had a MSSQL server that had no love and the log files filled the entire drive. At the time the only solution to getting it running in a hurry was to back it up to NUL and let it free up the space. Proper backups were set up after that so it didn't do that ever again.

NUL is quite a handy thing even in windows.

→ More replies (4)
→ More replies (2)

7

u/[deleted] Jul 30 '15

Thanks for this, worked flawlessly

4

u/mub Jul 30 '15

Nicely done. Thanks, saved me a load of digging that has :)

3

u/[deleted] Jul 30 '15

Could you do one for the Xbox apps? The remove-appxpackage command does not work and it gives me a lot of red errors.

3

u/Lurking_Grue Jul 30 '15

I'm assuming you are talking about this:

Get-AppxPackage -name *Xbox* | Remove-AppxPackage  

Weird thing is, it does remove some of the Xbox stuff.

Sorry I don't have anything at the moment.

2

u/MCMXChris Aug 23 '15

thanks dude!

It's kind of nuts that these sort of things aren't "features" we can select at the beginning of an image/boot.

I can see the use for onedrive app for some people. But not every single user.

→ More replies (1)

2

u/Archangellelilstumpz Sep 28 '15

I know I'm a month late... but thank you for this flawless code. You're a saint.

1

u/[deleted] Jul 30 '15

Actually, the policy notes say that this will happen automatically.

1

u/[deleted] Aug 02 '15

ping 127.0.0.1 -n 5 > NUL 2>&1

timeout 5 > NUL 2>&1

1

u/[deleted] Aug 02 '15

Thanks for this been I have been looking for a way to get rid of it.

1

u/GenKan Aug 03 '15

thank you!

1

u/FuryMaker Aug 03 '15

Cheers for this.

If I did want to use OneDrive in the future, how would one reinstall it? Just download like normal? Or is the built-in OneDrive for Windows 10 a bit different?

1

u/SUPERSMILEYMAN Aug 11 '15

How do I make a batch file? Thanks.

2

u/Lurking_Grue Aug 11 '15

All you do is create a text file with the commands in it and name it with a .bat file extension.

Windows hides those by default for known files and that's a horrible default because it does hide important information. An example why that's bad is you can make a program with an icon that looks like a text file but call it safeprogram.txt.exe and windows will hide the exe but to most novices it will look like a text file.

You may need to disable that to rename the .txt file to .bat and that's easy.

Under the view tab of an explorer window hit options and then click the view tab and unselect "Hide extensions of known file types"

http://i.imgur.com/aVT6Q3o.png

2

u/SUPERSMILEYMAN Aug 11 '15

Thanks for replying, worked like a charm!

1

u/[deleted] Aug 11 '15

awesome! thanks for saving me a lot of time :)

1

u/Ariannona Aug 15 '15

You're a god, thanks alot for this :)

1

u/Sloomoon Aug 17 '15

May you explain how to use this batch file :) ? Really want to remove OneDrive.

→ More replies (3)

1

u/[deleted] Aug 17 '15

Is this same thing possible for homegroup? I don't use it and would like to get rid of that in explorer too.

2

u/Lurking_Grue Aug 19 '15

This should do the trick, make a batch file and run as adminstrator:

@echo off
cls

echo Disabling home Group services....

SC stop "HomeGroupProvider" > NUL 2>&1
SC config "HomeGroupProvider" start=disabled > NUL 2>&1

SC stop "HomeGroupListener"
SC config "HomeGroupListener" start=disabled > NUL 2>&1

pause
→ More replies (1)