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.

27 lines
1.1 KiB

  1. @echo off
  2. @if "%1"=="" goto usage
  3. @if "%1"=="/?" goto usage
  4. @if "%1"=="-?" goto usage
  5. @if "%SDXROOT%"=="" goto usage
  6. set searchfor=
  7. set NEWBRANCH=%1
  8. if exist %temp%\sd.map del /q %temp%\sd.map
  9. FOR /F "usebackq tokens=3" %%i in (`findstr /i branch %SDXROOT%\sd.map`) do set searchfor=%%i
  10. @if NOT "%echoon%"=="" echo SEARCHFOR value is: %searchfor%
  11. FOR /F "tokens=1-3*" %%i in (%SDXROOT%\sd.map) DO if /i "%%i"=="Branch" ( echo %%i %%j %newbranch% >>%temp%\sd.map) ELSE ( @echo %%i %%j %%k %%l >>%temp%\sd.map)
  12. attrib -r -h -s %SDXROOT%\sd.map
  13. xcopy /r /y %TEMP%\sd.map %SDXROOT%\
  14. call sdx enlist -q zaw >%temp%\trash 2>&1
  15. call sdx defect -q zaw >%temp%\trash 2>&1
  16. attrib +r +h +s %SDXROOT%\sd.map
  17. goto end
  18. :error
  19. @echo This update was unsuccessful. Please examine the sd.map file carefully, as it may be broken.
  20. goto end
  21. :usage
  22. @echo HACKMAP ^<branch name^>
  23. @echo Branch name argument will be inserted as the value for the BRANCH line in the sd.map file
  24. @echo in the users enlistment.
  25. @echo This script must be run from within a razzle environment.
  26. :end