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.

58 lines
1.4 KiB

  1. @echo off
  2. rem COPYLOGS FROM_INDEX TO_INDEX FROM_MACHINE_NAME TO_DIR_NAME [opt_dir_path]
  3. REM
  4. REM Copy a set of log files from a given machine to a given dir.
  5. rem
  6. if "%4"=="" goto USAGE
  7. set from_index=%1
  8. set to_index=%2
  9. set from_mach=%3
  10. set to_dir=%4
  11. set /a found_one=0
  12. REM
  13. REM The path on the machines to the log file dir.
  14. REM
  15. set LOG_PATH=d$\winnt\debug
  16. if NOT "%5"=="" set LOG_PATH=%5
  17. if NOT EXIST %to_dir% (
  18. echo Error: Target directory "%to_dir%" not found.
  19. echo .
  20. goto USAGE
  21. )
  22. if NOT EXIST \\%from_mach%\%LOG_PATH% (
  23. echo Error: Source computer directory "\\%from_mach%\%LOG_PATH%" not found.
  24. echo .
  25. goto USAGE
  26. )
  27. echo copying log files %from_index% - %to_index% from: \\%from_mach%\%LOG_PATH%\NtFrs_nnnn.log to: %to_dir%
  28. for /l %%x in (%from_index%, 1, %to_index%) do (
  29. rem Put leading zeros on the number part.
  30. set number=0000000%%x
  31. set fname=NtFrs_!number:~-4!.log
  32. if EXIST \\%from_mach%\%LOG_PATH%\!fname! (
  33. copy \\%from_mach%\%LOG_PATH%\!fname! %to_dir% 1>nul: 2>nul:
  34. set /a found_one=!found_one!+1
  35. )
  36. )
  37. echo !found_one! log files copied.
  38. @goto QUIT
  39. :USAGE
  40. echo .
  41. echo COPYLOGS FROM_INDEX TO_INDEX FROM_MACHINE_NAME TO_DIR_NAME [optional_dir_path]
  42. echo e.g. copylogs 13 50 computerfoo foologs
  43. echo copies the ntfrs logs numbered 13 to 50 from computerfoo to foologs\
  44. echo The default log dir path is 'd$\winnt\debug'
  45. echo .
  46. :QUIT