Kaseya Community

COMPLETELY uninstall OneDrive from WIndows 10

  • I know you can DisableFileSyncNGSC = 1 in the registry, but I want to completely uninstall One Drive.

    If you run the  OneDriveSetup.exe /uninstall it does a UAC prompt.   I can't find any strings/ways to silently uninstall the app.   Any ideas?

    Here's a Procedure I have so far, don't laugh, I'm not a programmer, and it's not complete:

    <?xml version="1.0" encoding="UTF-8"?>

    -<ScriptExport xmlns="http://www.kaseya.com/vsa/2008/12/Scripting" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


    -<Procedure treeFullPath="myProcedures - cshockley.Remove Software" folderId="864381726954309" id="1058293730" treePres="3" name="Remove OneDrive">


    -<Body description="">


    -<If description="">


    -<Condition name="Windows 32 or 64 Bit Check">

    <Parameter name="Condition" value="Exists" xsi:type="EnumParameter"/>

    </Condition>


    -<Then>


    -<Statement name="CloseApplication" continueOnFail="false">

    <Parameter name="ApplicationName" value="OneDrive.exe" xsi:type="StringParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Ended OneDrive Task" xsi:type="StringParameter"/>

    </Statement>


    -<If description="">


    -<Condition name="TestFile">

    <Parameter name="Path" value="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe" xsi:type="StringParameter"/>

    <Parameter name="Condition" value="Exists" xsi:type="EnumParameter"/>

    <Parameter name="Value" value="" xsi:type="StringParameter"/>

    </Condition>


    -<Then>


    -<Statement name="ExecuteFile" continueOnFail="false">

    <Parameter name="Path" value="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe" xsi:type="StringParameter"/>

    <Parameter name="Arguments" value="/uninstall" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="WaitComplete" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="PauseScript" continueOnFail="false">

    <Parameter name="Seconds" value="8" xsi:type="IntegerParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Uninstalled OneDrive Application" xsi:type="StringParameter"/>

    </Statement>

    </Then>

    </If>


    -<Statement name="ExecuteShellCommand" continueOnFail="false">

    <Parameter name="Command" value="if exist "%USERPROFILE%\OneDrive" rd "%USERPROFILE%\OneDrive" /s /q" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="Is64Bit" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="ExecuteShellCommand" continueOnFail="false">

    <Parameter name="Command" value="if exist "c:\OneDriveTemp" rd "c:\OneDriveTemp" /s /q" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="Is64Bit" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="ExecuteShellCommand" continueOnFail="false">

    <Parameter name="Command" value="if exist "%LOCALAPPDATA%\Microsoft\OneDrive" rd "%LOCALAPPDATA%\Microsoft\OneDrive" /s /q" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="Is64Bit" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="ExecuteShellCommand" continueOnFail="false">

    <Parameter name="Command" value="if exist "%PROGRAMDATA%\Microsoft OneDrive" rd "%PROGRAMDATA%\Microsoft OneDrive" /s /q" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="Is64Bit" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Removed OneDrive Temp & Working Directories" xsi:type="StringParameter"/>

    </Statement>


    -<If description="">


    -<Condition name="CheckRegistryValue64">

    <Parameter name="RegistryPath" value="HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" xsi:type="StringParameter"/>

    <Parameter name="Condition" value="Exists" xsi:type="EnumParameter"/>

    <Parameter name="Value" value="" xsi:type="StringParameter"/>

    </Condition>


    -<Then>


    -<Statement name="DeleteRegistryKey64" continueOnFail="false">

    <Parameter name="Path" value="HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" xsi:type="StringParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ OneDrive Registry Entry #1 Deleted" xsi:type="StringParameter"/>

    </Statement>

    </Then>


    -<Else>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ OneDrive Registry Entry #1 Did Not Exist" xsi:type="StringParameter"/>

    </Statement>

    </Else>

    </If>


    -<If description="">


    -<Condition name="CheckRegistryValue64">

    <Parameter name="RegistryPath" value="HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" xsi:type="StringParameter"/>

    <Parameter name="Condition" value="Exists" xsi:type="EnumParameter"/>

    <Parameter name="Value" value="" xsi:type="StringParameter"/>

    </Condition>


    -<Then>


    -<Statement name="DeleteRegistryKey64" continueOnFail="false">

    <Parameter name="Path" value="HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" xsi:type="StringParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Removed OneDrive Registry Entry #2" xsi:type="StringParameter"/>

    </Statement>

    </Then>


    -<Else>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ OneDrive Registry Entry #2 Did Not Exist" xsi:type="StringParameter"/>

    </Statement>

    </Else>

    </If>


    -<Statement name="SetRegistryValue64" continueOnFail="false">

    <Parameter name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive\DisableFileSyncNGSC" xsi:type="StringParameter"/>

    <Parameter name="Value" value="1" xsi:type="StringParameter"/>

    <Parameter name="DataType" value="Integer" xsi:type="EnumParameter"/>

    </Statement>


    -<If description="">


    -<Condition name="CheckRegistryValue64">

    <Parameter name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive\DisableFileSyncNGSC" xsi:type="StringParameter"/>

    <Parameter name="Condition" value="Exists" xsi:type="EnumParameter"/>

    <Parameter name="Value" value="" xsi:type="StringParameter"/>

    </Condition>


    -<Then>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Disable OneDrive via Group Policy" xsi:type="StringParameter"/>

    </Statement>

    </Then>


    -<Else>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Set OneDrive Group Policy FAILED" xsi:type="StringParameter"/>

    </Statement>

    </Else>

    </If>

    </Then>


    -<Else>


    -<Statement name="CloseApplication" continueOnFail="false">

    <Parameter name="ApplicationName" value="OneDrive.exe" xsi:type="StringParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Ended OneDrive Task" xsi:type="StringParameter"/>

    </Statement>


    -<If description="">


    -<Condition name="TestFile">

    <Parameter name="Path" value="%SYSTEMROOT%\System32\OneDriveSetup.exe" xsi:type="StringParameter"/>

    <Parameter name="Condition" value="Exists" xsi:type="EnumParameter"/>

    <Parameter name="Value" value="" xsi:type="StringParameter"/>

    </Condition>


    -<Then>


    -<Statement name="ExecuteFile" continueOnFail="false">

    <Parameter name="Path" value="%SYSTEMROOT%\System32\OneDriveSetup.exe" xsi:type="StringParameter"/>

    <Parameter name="Arguments" value="/uninstall" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="WaitComplete" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="PauseScript" continueOnFail="false">

    <Parameter name="Seconds" value="8" xsi:type="IntegerParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Uninstalled OneDrive Application" xsi:type="StringParameter"/>

    </Statement>

    </Then>


    -<Else>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ OneDrive Application Not Installed" xsi:type="StringParameter"/>

    </Statement>

    </Else>

    </If>


    -<Statement name="ExecuteShellCommand" continueOnFail="false">

    <Parameter name="Command" value="if exist "%USERPROFILE%\OneDrive" rd "%USERPROFILE%\OneDrive" /s /q" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="Is64Bit" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="ExecuteShellCommand" continueOnFail="false">

    <Parameter name="Command" value="if exist "c:\OneDriveTemp" rd "c:\OneDriveTemp" /s /q" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="Is64Bit" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="ExecuteShellCommand" continueOnFail="false">

    <Parameter name="Command" value="if exist "%LOCALAPPDATA%\Microsoft\OneDrive" rd "%LOCALAPPDATA%\Microsoft\OneDrive" /s /q" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="Is64Bit" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="ExecuteShellCommand" continueOnFail="false">

    <Parameter name="Command" value="if exist "%PROGRAMDATA%\Microsoft OneDrive" rd "%PROGRAMDATA%\Microsoft OneDrive" /s /q" xsi:type="StringParameter"/>

    <Parameter name="ExecuteAccount" value="User" xsi:type="EnumParameter"/>

    <Parameter name="Is64Bit" value="False" xsi:type="BooleanParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Removed OneDrive Temp & Working Directories" xsi:type="StringParameter"/>

    </Statement>


    -<Statement name="DeleteRegistryKey" continueOnFail="false">

    <Parameter name="Path" value="HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6" xsi:type="StringParameter"/>

    </Statement>


    -<Statement name="DeleteRegistryKey" continueOnFail="false">

    <Parameter name="Path" value="HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" xsi:type="StringParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Removed OneDrive Registry Entries" xsi:type="StringParameter"/>

    </Statement>


    -<Statement name="SetRegistryValue" continueOnFail="false">

    <Parameter name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive\DisableFileSyncNGSC" xsi:type="StringParameter"/>

    <Parameter name="Value" value="1" xsi:type="StringParameter"/>

    <Parameter name="DataType" value="Integer" xsi:type="EnumParameter"/>

    </Statement>


    -<Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter name="Comment" value="$OD$ Disable OneDrive via Group Policy" xsi:type="StringParameter"/>

    </Statement>

    </Else>

    </If>

    </Body>

    </Procedure>

    </ScriptExport>

  • I'ts like trying to remove IE from windows 7 - fundamentally, you just can't - It's a built in part of the OS and isn't removable If you try, things tend to break.

    Things like microsoft office 201x and Office 365 expect it - and break if it's missing. non-obvious things like SFC and DISM will throw errors if it's missing.

    Disable it if you want, but don't remove it.