
- WINDOWS 10 UNINSTALL ONEDRIVE FOR BUSINESS INSTALL
- WINDOWS 10 UNINSTALL ONEDRIVE FOR BUSINESS WINDOWS
WINDOWS 10 UNINSTALL ONEDRIVE FOR BUSINESS WINDOWS
Reg load HKU\$($DU.SID) $($DU.RECOMMENDED: Click here to fix Windows issues and optimize system performance $DefaultUserRun = "registry::HKEY_USERS\$($DU.SID)\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" $DUpath = "$($(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\').default)\NTUSER.DAT" The Installer still exists on the system but it never actually called. It will dynamically find the Default User Hive, load it, remove the Key then unload the hive. Save the following as a PS1 file and call it in your Task Sequence Strlogfile.WriteLine Now & vbTab & Folderlocation & Foldername & " not found."Ĭall DeleteRegKey(chr(34) & "HKEY_CLASSES_ROOT\CLSID\ /t REG_DWORD /v System.IsPinnedToNameSpaceTree /d 0 /f If objFSO.FolderExists(Folderlocation & Foldername) Then objFSO.DeleteFolder Folderlocation & Foldername, DeleteReadonly strlogfile.WriteLine Now & vbTab & Folderlocation & Foldername & " folder successfully deleted." Sub DeleteFolder(Folderlocation, Foldername) Sub UninstallSetup(strAppName, strSetupExe, strCmd) If objFSO.FileExists(strSetupExe) Then strlogfile.WriteLine Now & vbTab & "Running removal commandline - " & strSetupExe & strCmd Executingpath = chr(34) & strSetupExe & chr(34) & strCmd intRet = objShell.Run(Executingpath, 0, True) strlogfile.WriteLine Now & vbTab & "Removal of " & strAppName & " - return code: " & intRet Else strlogfile.WriteLine Now & vbTab & strSetupExe & " not found! Removal failed." strlogfile.WriteLine "*****************************************************************************" strlogfile.WriteLine "" Wscript.quit End IfĬall DeleteFolder(ProgramData, "\Microsoft OneDrive") StrLogfile.WriteLine Now & vbTab & "Task Complete" '- 'Un-install setup exe Call UninstallSetup("OneDrive Setup", "C:\Windows\SysWOW64\OneDriveSetup.exe", " /uninstall /silent") Strlogfile.WriteLine Now & vbTab & "Removing " & strAppName ' CREATE UNINSTALL SCRIPT - EDIT OR REMOVE THIS SECTION AS REQUIRED '- sArchitecture = GetObject("winmgmts:root\cimv2:Win32_Processor='cpu0'").AddressWidth If sArchitecture = "32" Then ProgramFilesDrive = objShell.ExpandEnvironmentStrings("%PROGRAMFILES%") SoftwareRegKeyPath = "SOFTWARE\" WindowsSysDir = "%SYSTEMROOT%\System32" Else ProgramFilesDrive = objShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") SoftwareRegKeyPath = "SOFTWARE\Wow6432Node\" WindowsSysDir = "%SYSTEMROOT%\SysWOW64" End If '- If objFSO.FileExists(strLogFolder & "\" & sLogFilename) Then Set strlogfile = objFSO.OpenTextFile(strLogFolder & "\" & sLogFilename, ForAppending, True) Else Set strlogfile = objFSO.CreateTextFile(strLogFolder & "\" & sLogFilename) End If '' Create log file for trouble shooting VB script SLogFilename = "OneDrive_VBSUninstall.log" 'sLogFilename = "Test_App_1.0_VBSInstall.log" StrLogFolder = "C:\Logs" If not objFSO.FolderExists(strLogFolder) Then objFSO.CreateFolder strLogFolder End If Set strUser = objFSO.GetFolder(strProfile) ProgramData = objShell.ExpandEnvironmentStrings("%PROGRAMDATA%") StrPathName = Left(wscript.ScriptFullName, Instrrev(wscript.ScriptFullName,"\"))ĪllDesktop = objShell.expandenvironmentstrings("%PUBLIC%" & "\Desktop\")ĪllStartMenu = objShell.expandenvironmentstrings("%PROGRAMDATA%" & "\Microsoft\Windows\Start Menu\Programs\") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objShell = CreateObject("WScript.Shell") Comment or un-comment sections as required.ĭim objShell, objFSO, strPathName, strlogfile, strLogFolder, sArchitectureĭim AllDesktop, AllStartMenu, ProgramDataĭim strProfile, strUser, UserDesktop, AppData, LocalAppData, LocalLowAppData The script will create a verbose log file for the tasks/actions. This VBS scripts installs and/or removals ' This script has been created to assist with SCCM.
/001-how-to-remove-onedrive-from-windows-10-computers-444c99eb32144d6cb616ac361f1483bf.jpg)
I'm not a great scripter so but they work.
WINDOWS 10 UNINSTALL ONEDRIVE FOR BUSINESS INSTALL
(Caveat - IIRC OneDrive changes are due for a unified sync client that serves both Personal & Business functions, plus ability to sign-into Personal Once Drive within Office apps)īut anyway, GPP notwithstanding, from memory I think OneDrive install changed depending on OS build, so I included all the stuff I've used.
