Advertisement
s0m30n3

admin-reinit.cmd

Apr 15th, 2021
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @REM admin-reinit.cmd -- perform misc clean up for new Insider builds
  2. @REM MUST BE RUN AS ADMINISTRATOR!
  3. @echo off
  4. setlocal enableextensions
  5.  
  6. @REM set DEBUG=on
  7. if "%DEBUG%" == "on" (
  8.   echo on
  9.   prompt $G$z
  10. )
  11.  
  12. @echo.hide the Start menu's empty Maintenance directory
  13. cd /d "C:\ProgramData\Microsoft\Windows\Start Menu\Programs"
  14. attrib +h Maintenance /S /D
  15. attrib -s "Immersive*.lnk"
  16. attrib +s +h "Immersive*.lnk"
  17. attrib +h "Microsoft Office Tools" /S /D
  18. for %%f in (*) do @attrib +h "%%~f"
  19. @REM following moves Charmap to Accessories
  20. cd Accessories
  21. for %%f in ("System Tools"\*) do @mklink "%%~nxf" "%%~f" /h
  22. cd ..
  23. attrib +h Accessories /D
  24. attrib +h Accessibility /D
  25.  
  26. if "%DEBUG%" == "on" (pause) else (@echo.)
  27.  
  28. @echo.fix the registry
  29. set rk=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\UserSwitch
  30. set aclcmd=e:\bin\setacl64.exe
  31. set regcmd=c:\windows\system32\reg.exe
  32. if "%DEBUG%" == "on" pause
  33. %aclcmd% -on %rk% -ot reg -actn setowner -ownr "n:Administrators"
  34. %aclcmd% -on %rk% -ot reg -actn ace -ace "n:SYSTEM;p:set_val;m:deny"
  35. %regcmd%   add   %rk% /v Enabled /t REG_DWORD /d 1 /f
  36.  
  37. @REM fixing shell icons to hide compressed folder overlays which Insider builds revert
  38. set rk=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons
  39. %regcmd% add "%rk%" /v 179 /t REG_SZ /d "%Public%\Pictures\empty.ico" /f
  40.  
  41. if "%DEBUG%" == "on" (pause) else (@echo.)
  42.  
  43. @echo.disk cleanup (sadly, must be interactive)
  44. start cleanmgr /d c
  45.  
  46. if "%DEBUG%" == "on" (pause) else (@echo.)
  47.  
  48. @echo.Final Tweaks
  49. start "" "E:\opt\UWT4-Win10\Ultimate Windows Tweaker 4.8.exe"
  50.  
  51. @REM ALWAYS pause at end
  52. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement