@echo off
setlocal enabledelayedexpansion
::set to utf-8
chcp 65001
:: get time.
:: it is 1-13 under utf-8, 1-10 under gbk
set d=%date:~0,13%
set t=%time:~0,8%
:: /f options:
:: /f "skip=1 delims=:"
:: curl options:
:: curl -H "header here"
for /f "delims=;" %%i in ('curl www.somesite.com') do (
echo %d% %t% %%i
:: only read one line.
:: goto next = break
goto next
)
:next
echo\
pause
Windows下使用bat访问网页并提取标准输出
最新推荐文章于 2023-05-22 11:25:17 发布