OneDrive.bat out of date?  

Page 5 of 5 FirstFirst ... 345

  1. Posts : 194
    Windows 10
    Thread Starter
       #41

    Paul Black said:
    A little while ago I decided to try and write a Batch Script that completely removed OneDrive and ALL the leftovers!

    I came up with this but for some reason it DOESN'T remove the OneDriveSetup.exe file! . . .

    Code:
    @echo offecho.
    
    echo Terminating ANY OneDrive processes . . .
    taskkill /f /im OneDrive.exe
    
    echo.
    echo Uninstalling OneDrive .exe file from %SystemRoot%\SysWOW64\ . . .
    %SystemRoot%\SysWOW64\OneDriveSetup.exe /Uninstall
    
    echo.
    echo Removing directory %UserProfile%\OneDrive . . .
    RD "%UserProfile%\OneDrive" /S /Q
    
    echo.
    echo Removing directory %LocalAppData%\Microsoft\OneDrive . . .
    RD "%LocalAppData%\Microsoft\OneDrive" /S /Q
    
    echo.
    echo Removing directory %ProgramData%\Microsoft OneDrive . . .
    RD "%ProgramData%\Microsoft OneDrive" /S /Q
    
    echo.
    echo Removing directory %SystemDrive%\OneDriveTemp . . .
    RD "%SystemDrive%\OneDriveTemp" /S /Q
    
    echo.
    echo Deleting OneDrive .lnk Shorcut . . .
    DEL "%AppData%\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" /S /F /Q
    
    echo.
    echo Deleting REG Key \CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6} . . .
    rem System.IsPinnedToNameSpaceTree
    REG Delete "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /F
    
    echo.
    echo Deleting REG Key \Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6} . . .
    rem System.IsPinnedToNameSpaceTree
    REG Delete "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /F
    
    echo.
    echo Adding modified REG Key \CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6} . . .
    rem System.IsPinnedToNameSpaceTree
    REG ADD "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /V "System.IsPinnedToNameSpaceTree" /D "0" /T REG_DWORD /F
    
    echo.
    echo All processes completed!

    Have I left a LOT of important processes out?

    Thanks in advance.
    Did you fix it? If so let me know!!
      My Computer


  2. Posts : 7,598
    Windows 10 Home 20H2
       #42

    Paul Black said:
    it DOESN'T remove the OneDriveSetup.exe file! . . .
    Code:
    Microsoft Windows [Version 10.0.18362.30]
    (c) 2019 Microsoft Corporation. All rights reserved.
    
    C:\Windows\system32>Del %SystemRoot%\SysWOW64\OneDriveSetup.exe
    C:\Windows\SysWOW64\OneDriveSetup.exe
    Access is denied.
    Nevertheless, when I used PowerRun to run the same command, OneDriveSetup.exe was successfully deleted as shown below.
    Code:
    Microsoft Windows [Version 10.0.18362.30]
    (c) 2019 Microsoft Corporation. All rights reserved.
    
    E:\>Del %SystemRoot%\SysWOW64\OneDriveSetup.exe
    
    E:\>
    OneDrive.bat out of date?-onedrive-deleted.jpg
    Last edited by Matthew Wai; 15 Feb 2020 at 11:56.
      My Computer


  3. Posts : 7,598
    Windows 10 Home 20H2
       #43

    PowerRun is available here: PowerRun v1.3 (Run with highest privileges)

    I have not tried the following, but I think it will work.
    PowerRun_x64.exe Del %SystemRoot%\SysWOW64\OneDriveSetup.exe
      My Computer


  4. Posts : 194
    Windows 10
    Thread Starter
       #44

    Is there no way to make this not require a 3rd party? The one I originally posted just needed to be ran as an admin.
      My Computer


  5. Posts : 7,598
    Windows 10 Home 20H2
       #45

    In which version of Windows 10 did you run it?
    Obviously, the following commands can no longer delete OneDriveSetup.exe.

    %SystemRoot%\SysWOW64\OneDriveSetup.exe /Uninstall
    Del %SystemRoot%\SysWOW64\OneDriveSetup.exe
      My Computer


  6. Posts : 17,575
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #46

    Thanks for the replies, it is appreciated.

    I ran this in Win 10 Pro 1909.
    I even tried rebooting after running the cmd but that didn't make a difference.
    I Googled it and it seem that others who use that cmd have success, very strange!

    Thanks again.
      My Computer


  7. Posts : 7,598
    Windows 10 Home 20H2
       #47

    Others who have succeeded might run an older version of Windows 10.
      My Computer


  8. Posts : 194
    Windows 10
    Thread Starter
       #48

    So, did you get it working?
      My Computer


  9. Posts : 7,598
    Windows 10 Home 20H2
       #49

    It does not work without PowerRun on my Windows 10 Home 1903.
      My Computer


  10. Posts : 194
    Windows 10
    Thread Starter
       #50

    Bump.

    Still looking for a working script that removes everything!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 16:59.
Find Us




Windows 10 Forums