Get到一个新知识。
改成适合自己的- @echo off
- setlocal enabledelayedexpansion
- echo 1.百度 2.淘宝 3.BatHome
- choice /c 123
- if %errorlevel%==1 set URL=https://www.baidu.com/s?wd=
- if %errorlevel%==2 set URL=https://s.taobao.com/search?q=
- if %errorlevel%==3 set "URL=http://zhannei.baidu.com/cse/search?s=1324540215625407466&entry=1&ie=gbk&q="
- echo.
- 2>nul (
- :keyword
- set /p keyword=要找什么?
- if "!keyword!" EQU "" echo keyword不能为空&goto :keyword
- set /p _=!keyword!<nul >#
- if exist $ del $
- for %%# in (#) do fsutil file createnew $ %%~z# >nul
- for /f "tokens=2" %%# in ('fc /b # $') do if %%# NEQ # set URL=!URL!%%%%#
- del #
- del $
- start "" "!URL!"
- )
复制代码
|