Advertisement
s0m30n3

newbuild-fix.cmd

Apr 15th, 2021
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @REM newbuild-fix.cmd -- fixes for new Insider builds
  2. @set TRACE=on
  3. @REM @set DEBUG=on
  4. @echo %DEBUG% %TRACE% off
  5. @setlocal enableextensions
  6. @set PROMPT=$g
  7.  
  8. goto :BEGIN
  9.  
  10. This is for user account clean-up after new Insider Build installs.
  11. Note: this uses a backup for %USERPROFILE% under E:\archive.
  12.  
  13. :BEGIN
  14. set d=%APPDATA%\Microsoft\Windows\Start Menu\Programs
  15.  
  16. @REM here be the cruft I want to hide
  17. @REM --------------------------------
  18. pushd "%d%"
  19.  
  20. attrib +h "Maintenance" /D
  21. attrib +h "Accessibility" /D
  22. attrib +h "Administrative Tools" /D
  23.  
  24. @REM don't hide the following, delete them
  25. del "System Tools\Control Panel.lnk"
  26. del "System Tools\Run.lnk"
  27. del "System Tools\Settings.lnk"
  28. del "System Tools\computer.lnk"
  29. del "System Tools\Administrative Tools.lnk"
  30.  
  31. if exist "OneDrive.lnk" (
  32.     if exist "System Tools\OneDrive.lnk" (
  33.         del "OneDrive.lnk"
  34.     ) else (
  35.         move "OneDrive.lnk" "System Tools"
  36.     )
  37. )
  38.  
  39. @REM unfubar Accessories in Start Menu
  40. set d=%d%\Accessories
  41. set s=%d:C:\Users=E:\archive\win10%
  42. pushd "%s%"
  43. for %%f in (*.lnk) do if not exist "%d%\%%~nxf" copy "%%~f" "%d%"
  44. popd
  45.  
  46. popd
  47.  
  48. copy "%d:C:\users=E:\archive\win10%\System Tools\Command Prompt.lnk" "%d%\System Tools"
  49.  
  50. @REM get rid of unwanted Sent To entries
  51. set d=%APPDATA%\Microsoft\Windows\SendTo
  52. set s=E:\archive\win10\%d:*\Users\=%
  53. pushd "%d%"
  54. for %%f in (*) do @if not exist "%s%\%%~nxf" del "%%~f"
  55. popd
  56.  
  57.  
  58. "%LOCALAPPDATA%\Microsoft\Windows\Themes\my.theme"
  59. ping 127.0.0.1 -n 5 > nul
  60. taskkill /F /IM systemsettings.exe
  61.  
  62.  
  63. @REM following needed to prune [Win]+X menu
  64. @REM --------------------------------------
  65. set d=%LOCALAPPDATA%\Microsoft\Windows\WinX
  66. set s=%USERDIR%\archive\win10\%d:*\Users\=%
  67.  
  68. for /R "%d%" %%f in (*.lnk) do @call :PROCWINX "%%~f"
  69.  
  70. goto :CONTINUE
  71.  
  72. :PROCWINX
  73. set f=%~1
  74. set f=%f:*\WinX\=%
  75. if NOT EXIST "%s%\%f%" del "%d%\%f%"
  76. goto :EOF
  77.  
  78.  
  79. :CONTINUE
  80. taskkill /F /IM explorer.exe & start explorer
  81.  
  82. if "%DEBUG%" == "on" ( pause ) else ( if "%TRACE%" == "on" pause )
  83. @endlocal
  84. @set TRACE=
  85.  
  86. if "%RECONFIG_RESTART%" == "on" logoff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement