Created
June 2, 2014 14:44
-
-
Save pypykim/564d98233b0fca8c29f1 to your computer and use it in GitHub Desktop.
ftp1.bat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| echo PLEASE WAIT... | |
| mkdir d:\test | |
| echo ftpuser> d:\test\temp.ftp | |
| echo 123456>> d:\test\temp.ftp | |
| echo lcd d:\test>> d:\test\temp.ftp | |
| echo get test.zip>> d:\test\temp.ftp | |
| echo bye>> d:\test\temp.ftp | |
| ftp -s:d:\test\temp.ftp 172.31.10.194 > d:\test\output.txt | |
| find /i " KB/s)" d:\test\output.txt | |
| if errorlevel 1 goto MB | |
| find /i " MB/s)" d:\test\output.txt | |
| if errorlevel 1 goto KB | |
| goto error | |
| :KB | |
| set range=KB/s | |
| for /f "tokens=3 delims= " %%a in ('find /i "KB/s)" d:\test\output.txt') do set speed=%%a | |
| set speed=%speed:~1,4% | |
| goto next | |
| :MB | |
| set range=MB/s | |
| for /f "tokens=3 delims= " %%a in ('find /i "MB/s)" d:\test\output.txt') do set speed=%%a | |
| set speed=%speed:~1,4% | |
| goto next | |
| :error | |
| echo Your speed cannot be detected! | |
| goto end | |
| :next | |
| cls | |
| echo Your speed is: %speed% %range% | |
| echo. | |
| pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment