批处理Ping服务器

1 for /f "tokens=2,*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Desktop"') do (
2 set desk=%%j
3 )
4 date/t >>%desk%\log.txt
5 time/t >>%desk%\log.txt
6 ping -n 5 192.168.1.1 >>%desk%\log.txt
7 time/t >>%desk%\log.txt 
8 start %desk%\log.txt
9 exit

 

你可能感兴趣的:(ping)