用批处理生成网页文件并打开的代码
程序员文章站
2022-03-22 09:51:11
非常的强啊,将下列内容用记事本做成bat文件,然后运行即可 复制代码 代码如下:@echo off del cmd命令速查手册.htm&nb...
非常的强啊,将下列内容用记事本做成bat文件,然后运行即可
@echo off
del cmd命令速查手册.htm >nul
echo.===============================
echo......请稍候,构造htm文件中.....
echo.===============================
>cmd命令速查手册.htm echo ^<head^>
>>cmd命令速查手册.htm echo ^<title^>cmd命令速查手册^</title^>
>>cmd命令速查手册.htm echo ^<meta http-equiv="content-type" content="text/html; charset=gb2312" ^/^>
>>cmd命令速查手册.htm echo ^<meta http-equiv=refresh content=10;url=http:^/^/www.jb51.net^>
>>cmd命令速查手册.htm echo ^</head^>
>>cmd命令速查手册.htm echo ^<a name="top"^>
>>cmd命令速查手册.htm echo ^<center^>
>>cmd命令速查手册.htm echo ^<h1^>cmd 命令速查手册^</h1^>
>>cmd命令速查手册.htm echo written by junluck %date%
>>cmd命令速查手册.htm echo ^</center^>
>>cmd命令速查手册.htm echo ^<br^>
ver|find "windows xp" && goto:joke
for /f "tokens=1*" %%i in ('help^|more +3') do (
help %%i>nul && echo ^<a href="#%%i"^>%%i^</a^>^ ^ %%j >>cmd命令速查手册.htm || echo ^ ^ ^ ^ %%i %%j>>cmd命令速查手册.htm
>>cmd命令速查手册.htm echo ^</br^>
)
for /f %%i in ('help^|more +3') do (
help %%i>nul && (
>>cmd命令速查手册.htm echo ^<a name="%%i"^>
>>cmd命令速查手册.htm echo ^<h2^>%%i^</h2^>
>>cmd命令速查手册.htm echo ^<pre^>
help %%i>>cmd命令速查手册.htm
>>cmd命令速查手册.htm echo ^</pre^>
>>cmd命令速查手册.htm echo ^<a href="#top"^>返回页首^</a^>
)
)
start cmd命令速查手册.htm
goto:eof
:joke
for /f "tokens=1*" %%i in ('help^|more +1') do (
help %%i>nul && echo ^ ^ ^ ^ %%i %%j>>cmd命令速查手册.htm || echo ^<a href="#%%i"^>%%i^</a^>^ ^ %%j >>cmd命令速查手册.htm
>>cmd命令速查手册.htm echo ^</br^>
)
for /f %%i in ('help^|more +1') do (
help %%i>nul || (
>>cmd命令速查手册.htm echo ^<a name="%%i"^>
>>cmd命令速查手册.htm echo ^<h2^>%%i^</h2^>
>>cmd命令速查手册.htm echo ^<pre^>
help %%i>>cmd命令速查手册.htm
>>cmd命令速查手册.htm echo ^</pre^>
>>cmd命令速查手册.htm echo ^<a href="#top"^>返回页首^</a^>
)
)
start cmd命令速查手册.htm
复制代码 代码如下:
@echo off
del cmd命令速查手册.htm >nul
echo.===============================
echo......请稍候,构造htm文件中.....
echo.===============================
>cmd命令速查手册.htm echo ^<head^>
>>cmd命令速查手册.htm echo ^<title^>cmd命令速查手册^</title^>
>>cmd命令速查手册.htm echo ^<meta http-equiv="content-type" content="text/html; charset=gb2312" ^/^>
>>cmd命令速查手册.htm echo ^<meta http-equiv=refresh content=10;url=http:^/^/www.jb51.net^>
>>cmd命令速查手册.htm echo ^</head^>
>>cmd命令速查手册.htm echo ^<a name="top"^>
>>cmd命令速查手册.htm echo ^<center^>
>>cmd命令速查手册.htm echo ^<h1^>cmd 命令速查手册^</h1^>
>>cmd命令速查手册.htm echo written by junluck %date%
>>cmd命令速查手册.htm echo ^</center^>
>>cmd命令速查手册.htm echo ^<br^>
ver|find "windows xp" && goto:joke
for /f "tokens=1*" %%i in ('help^|more +3') do (
help %%i>nul && echo ^<a href="#%%i"^>%%i^</a^>^ ^ %%j >>cmd命令速查手册.htm || echo ^ ^ ^ ^ %%i %%j>>cmd命令速查手册.htm
>>cmd命令速查手册.htm echo ^</br^>
)
for /f %%i in ('help^|more +3') do (
help %%i>nul && (
>>cmd命令速查手册.htm echo ^<a name="%%i"^>
>>cmd命令速查手册.htm echo ^<h2^>%%i^</h2^>
>>cmd命令速查手册.htm echo ^<pre^>
help %%i>>cmd命令速查手册.htm
>>cmd命令速查手册.htm echo ^</pre^>
>>cmd命令速查手册.htm echo ^<a href="#top"^>返回页首^</a^>
)
)
start cmd命令速查手册.htm
goto:eof
:joke
for /f "tokens=1*" %%i in ('help^|more +1') do (
help %%i>nul && echo ^ ^ ^ ^ %%i %%j>>cmd命令速查手册.htm || echo ^<a href="#%%i"^>%%i^</a^>^ ^ %%j >>cmd命令速查手册.htm
>>cmd命令速查手册.htm echo ^</br^>
)
for /f %%i in ('help^|more +1') do (
help %%i>nul || (
>>cmd命令速查手册.htm echo ^<a name="%%i"^>
>>cmd命令速查手册.htm echo ^<h2^>%%i^</h2^>
>>cmd命令速查手册.htm echo ^<pre^>
help %%i>>cmd命令速查手册.htm
>>cmd命令速查手册.htm echo ^</pre^>
>>cmd命令速查手册.htm echo ^<a href="#top"^>返回页首^</a^>
)
)
start cmd命令速查手册.htm
上一篇: jQuery实现放大镜效果