EXPERIMENTAL : remove Onedrive setup from startup for new created account thanks to https://github.com/W4RH4WK/Debloat-Windows-10/
This commit is contained in:
parent
94eac016f3
commit
09b4d8ea28
1 changed files with 33 additions and 0 deletions
33
cleanW10.ps1
33
cleanW10.ps1
|
@ -113,6 +113,33 @@ function modify_shitty_reg_value {
|
||||||
Write-host -ForegroundColor Green "done"
|
Write-host -ForegroundColor Green "done"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Delete a reg key
|
||||||
|
# Params :
|
||||||
|
# path : the complete path to reg key
|
||||||
|
# key : key name
|
||||||
|
function delete_shitty_reg_key {
|
||||||
|
param([string]$path, [string]$key)
|
||||||
|
Write-Host -NoNewline "`tDelete key $key reg : "
|
||||||
|
if (!(Test-Path $path)){
|
||||||
|
Write-Host -ForegroundColor Red -NoNewline "path not found"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Remove-ItemProperty -Path $path -Name $key
|
||||||
|
}
|
||||||
|
catch [System.Security.SecurityException]{
|
||||||
|
Write-Host -ForegroundColor Red "access denied"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Host -ForegroundColor Red "error"
|
||||||
|
Write-Host "`t$Error[0]"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Write-host -ForegroundColor Green "done"
|
||||||
|
}
|
||||||
|
|
||||||
# Function to remove shitty prog from shitty win
|
# Function to remove shitty prog from shitty win
|
||||||
# Params :
|
# Params :
|
||||||
# $name : Feature name
|
# $name : Feature name
|
||||||
|
@ -255,6 +282,12 @@ Remove-PSDrive -Name HKCR
|
||||||
Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | foreach {
|
Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | foreach {
|
||||||
remove_shitty_tasks $_
|
remove_shitty_tasks $_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" | Out-Null
|
||||||
|
New-PSDrive -PSProvider Registry -Root HKEY_USERS -Name HKU | Out-Null
|
||||||
|
delete_shitty_reg_key "HKU:\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "OneDriveSetup"
|
||||||
|
Remove-PSDrive -Name HKU
|
||||||
|
reg unload "hku\Default" | Out-Null
|
||||||
Start-Process "explorer.exe"
|
Start-Process "explorer.exe"
|
||||||
|
|
||||||
#Advertiging...
|
#Advertiging...
|
||||||
|
|
Reference in a new issue