路由跟踪.bat 812 B

123456789101112131415161718192021
  1. ::获取系统时间;
  2. @set datetime=%date:~0,4% %date:~5,2% %date:~8,2%-%time:~0,2% %time:~3,2% %time:~6,2%
  3. ::去除所有空格;
  4. @set datetime=%datetime: =%
  5. :: 判断文件夹是否存在,不存在创建;
  6. set logpath=.\log\tracert
  7. if not exist %logpath% (@md .\log\tracert)
  8. :: -h表示跟踪的最大跃点数;
  9. :: -w表示等待每个回复的超时值,毫秒;
  10. tracert -h 50 -w 3000 huizhou.idmanage.qhmoka.com > .\log\tracert\%datetime%.log
  11. ::获取系统时间;
  12. @set datetime=%date:~0,4% %date:~5,2% %date:~8,2%-%time:~0,2% %time:~3,2% %time:~6,2%
  13. ::去除所有空格;
  14. @set datetime=%datetime: =%
  15. :: 判断文件夹是否存在,不存在创建;
  16. set logpath=.\log\ping
  17. if not exist %logpath% (@md .\log\ping)
  18. :: -n 表示要ping的次数;
  19. ping huizhou.idmanage.qhmoka.com -n 60 > .\log\ping\%datetime%.log