Advertisement
Guest User

Unbloat-Win10

a guest
Jul 31st, 2015
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Const HKLM   = &h80000002
  2. Const HKCU   = &H80000001
  3. Const DELETE = &h10000
  4.  
  5. Set sh = CreateObject("WScript.Shell")
  6.  
  7. Set fso = CreateObject("Scripting.FileSystemObject")
  8. CurrentDirectory = fso.GetAbsolutePathName(".")
  9. temploc = sh.ExpandEnvironmentStrings("%temp%")
  10.  
  11. Set reg = GetObject("winmgmts://./root/default:StdRegProv")
  12. reg.CheckAccess HKLM, "SYSTEM\CurrentControlSet", DELETE, isAdmin
  13.  
  14. If Not isAdmin Then
  15.   ' Copie du CMD et du fichier REG vers le dossier temporaire
  16.  sourceCMDfile = fso.buildpath(CurrentDirectory, "OneDrive.CMD")
  17.   sourceREGfile = fso.buildpath(CurrentDirectory, "Cortana-Tel-Biom-Nolock.reg")
  18.   fso.CopyFile sourceCMDfile, temploc & "\"
  19.   fso.CopyFile sourceREGfile, temploc & "\"  
  20.   If WScript.Arguments.Count = 0 Then
  21.     ' Ouverture du script avec élévation de privilèges
  22.    CreateObject("Shell.Application").ShellExecute WScript.FullName, _
  23.       Chr(34) & WScript.ScriptFullName & Chr(34) & " uac", _
  24.       sh.CurrentDirectory, "runas", 1
  25.     WScript.Quit 0
  26.   Else
  27.     WScript.Echo "Privilege elevation failed!"
  28.     WScript.Quit 1
  29.   End If
  30. Else
  31.   ' Si le script dispose des privilèges
  32.  
  33.   ' Création des variables d exectuion
  34.  temploc = sh.ExpandEnvironmentStrings("%temp%")
  35.   sourceCMDfile = fso.buildpath(temploc, "OneDrive.CMD")
  36.   sourceREGfile = fso.buildpath(temploc, "Cortana-Tel-Biom-Nolock.reg")
  37.   Timeri Fiedler-Valenta
  38.   ' Suppression par Powershell des Apps préinstallées
  39.  Dim apps
  40.   Dim app
  41.   apps = Array("3DBuilder", _
  42.                       "Getstarted", _
  43.                       "MicrosoftOfficeHub", _
  44.                       "MicrosoftSolitaireCollection", _
  45.                       "SkypeApp", _
  46.                       "WindowsMaps", _
  47.                       "BingWeather", _
  48.                       "Office.OneNote", _
  49.                       "XboxApp", _
  50.                       "ZuneMusic", _
  51.                       "ZuneVideo", _
  52.                       "BingSports", _
  53.                       "BingNews", _
  54.                       "WindowsPhone", _
  55.                       "BingFinance", _
  56.                       "WindowsSoundRecorder", _
  57.                       "Windows.Photos", _
  58.                       "WindowsCamera", _
  59.                       "WindowsAlarms", _
  60.                       "People", _
  61.                       "MicrosoftEdge")
  62.   For Each  app In apps
  63.     sh.Run("powershell.exe Get-AppxPackage -AllUsers -Name Microsoft." & app & " | Remove-AppxPackage")
  64.   Next
  65.  
  66.   ' Execution du CMD OneDrive
  67.    sh.Run("cmd.exe " & sourceCMDfile)
  68.  
  69.   ' Ajout des informations au registre
  70.  sh.Run "regedit.exe /s " & Chr(34) & sourceREGfile & Chr(34), 0, True
  71.  
  72.   ' Suppression par Powershell des services de tracking
  73.  sh.Run("powershell.exe sc delete DiagTrack")
  74.   sh.Run("powershell.exe sc delete dmwappushservice")
  75.   sh.Run("powershell.exe echo "" > C:\ProgramData\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl")
  76.  
  77.   ' Suppression des fichiers temporaires
  78.  fso.DeleteFile sourceCMDfile
  79.   fso.DeleteFile sourceREGfile
  80. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement