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.

51 lines
890 B

  1. @echo off
  2. if "%1"== "" goto :Usage
  3. set Dest=%1
  4. sd opened > sudarc_save_opened.tmp
  5. for /F "tokens=2,3* delims=/" %%i in (sudarc_save_opened.tmp) do (
  6. rem echo %%j
  7. set FilePath=%SDXROOT%
  8. call :AddRemainingPath %%j %%k
  9. call :CopyFileToDest
  10. )
  11. del sudarc_save_opened*.tmp
  12. goto :End
  13. :AddRemainingPath
  14. rem echo AddRemainingPath (%1 %2)
  15. echo %1 > sudarc_save_opened2.tmp
  16. findstr # sudarc_save_opened2.tmp > sudarc_save_opened3.tmp
  17. if NOT ERRORLEVEL=1 (
  18. for /F "tokens=1* delims=#" %%i in ("%1") do (
  19. call :AddRemainingPath %%i)
  20. goto :EOF
  21. )
  22. set FilePath=%FilePath%\%1
  23. if "%2"=="" goto :EOF
  24. for /F "tokens=1* delims=/ " %%i in ("%2") do (
  25. call :AddRemainingPath %%i %%j)
  26. goto :EOF
  27. :CopyFileToDest
  28. echo copy %FilePath% %Dest%
  29. copy %FilePath% %Dest%
  30. goto :EOF
  31. :Usage
  32. echo Usage:
  33. echo "sudarc_save_opened <path to save>"
  34. goto :End
  35. :End