Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
1.4 KiB

  1. @echo off
  2. if "%1"=="" goto usage
  3. set SOURCE_PATH=%1
  4. rem
  5. rem Update the "Documents and Settings" folder
  6. rem
  7. call :copysettings
  8. rem
  9. rem The following will generate lots of "can't add foo, already opened or edit"
  10. rem
  11. sd add -t text "documents and settings\..."
  12. rem
  13. rem Update all of the hive files
  14. rem
  15. for %%f in (%SOURCE_PATH%\windows\system32\config\*.*) do call :newhive %%f %%~nxf
  16. rem
  17. rem Friendly reminder
  18. rem
  19. echo Refresh complete. Don't forget to submit changes!
  20. goto :eof
  21. :newhive
  22. sd edit bins\%2
  23. copy %1 bins\%2
  24. sd add bins\%2
  25. goto :eof
  26. :usage
  27. echo.
  28. echo refresh ^<template-root^>
  29. echo.
  30. echo where ^<template-root^> is the UNC path to the C: root of the template
  31. echo 32-bit installation. See howto.txt for details.
  32. echo.
  33. goto :eof
  34. :copysettings
  35. set SRC=%SOURCE_PATH%\documents and settings
  36. set DST=.\Documents and Settings
  37. call :dodir
  38. pushd %DST%
  39. attrib -s -h *.* /S /D
  40. popd
  41. goto :eof
  42. :dodir
  43. rem
  44. rem %1 is directory to process
  45. rem
  46. set CUR=%1
  47. :getcmd
  48. shift
  49. if "%1"=="" goto gotcmd
  50. set CUR=%CUR% %1
  51. goto :getcmd
  52. :gotcmd
  53. rem
  54. rem Create this directory and process all child directories
  55. rem
  56. md "%DST%%CUR%" 1>NUL 2>NUL
  57. SETLOCAL
  58. for /f "delims=" %%F in ('dir /B /AD "%SRC%%CUR%"') do call :dodir %CUR%\%%F
  59. ENDLOCAL
  60. rem
  61. rem Now process all files
  62. rem
  63. xcopy /hf "%SRC%%CUR%" "%DST%%CUR%"
  64. pushd "%SRC%%CUR%"
  65. popd
  66. goto :eof