- ·上一篇文章:for语句中的几种分隔符形式
- ·下一篇文章:Norton Ghost批处理命令用法详细介绍
hitme批处理集合
stname对应表 echo.IP ^<=^> Host_name's Table echo. ( echo.IP ^<=^> Host_name's Table echo. ) >hostname.txt for /l %%i in (%n1%,1,%n2%) do ( ping -n 1 -w 1 %ip%.%%i |find "Reply" >nul 2>nul && ( for /f %%b in ('nbtstat -a "%ip%"."%%i"^|findstr /r /c:"\<20\> UNIQUE"') do ( echo.%ip%.%%i%%b echo.%ip%.%%i%%b>>hostname.txt ) ) ) findstr /n "." hostname.txt |findstr /r "^3:" && start hostname.txt endlocal goto :menu ::------------------------------------------------------------------ ------------ :group setlocal cls mode con:cols=40 lines=40 color f1 title IP与Workgroup对应表 echo.IP ^<=^>Group Name's Table echo. ( echo.IP ^<=^>Group Name's Table echo. ) >group.txt for /l %%i in (%n1%,1,%n2%) do ( ping -n 1 -w 1 %ip%.%%i |find "Reply" >nul 2>nul && ( for /f %%c in ('nbtstat -a "%ip%"."%%i"^|findstr /r /c:"\<00\> GROUP"') do ( echo.%ip%.%%i%%c echo.%ip%.%%i%%c>>group.txt ) ) ) findstr /n "." group.txt |findstr /r "^3:" && start group.txt endlocal goto :menu :msbrowse cls title 查询WHO是主控域浏览器? echo.查询中......... for /l %%i in (%n1%,1,%n2%) do ( ping -n 1 -w 1 %ip%.%%i |find "Reply" >nul 2>nul && ( nbtstat -a %ip%.%%i|findstr "__MSBROWSE__" 2>nul >nul && ( echo.主控域浏览器是:%ip%.%%i pause goto :menu ) ) ) cls echo.未找到......汗 & pause & goto:menu :end cls echo. echo.written by hitme 2005.08.18 pause goto :eof net_Tab.rar 38. cmd 39. 闲来无聊,瞎搞一个,测试 功能:统计每个单词在文本中出现的次数 用法: cmd下 word_num 文件名 统计结果样式: 0152 fixed 0108 added 0094 in 0091 to 0070 will 0069 not 0062 problem 0059 the 0056 bar 0054 support 0054 at 0053 and 0050 for 0047 menu 0046 tab 0042 when 0041 new 0040 option 0040 changed 0038 myie2 0037 plugin 0036 favorite 0035 toolbar 0035 on 代码 @echo off cls echo. echo.----------------------------- echo....统计中.....请少等... echo.----------------------------- echo. if "%*" "" goto :syntax if "%*" "/?" goto :syntax if "%*" "/" goto :syntax if "%*" "?" goto :syntax if /i "%*" "/help" goto :syntax :: /* 拆解文本为每行一单词 */ setlocal ENABLEDELAYEDEXPANSION del end.txt tmp*.txt 2>nul set /a m=0 :loop set /a m+=1 for /f "tokens=%m% delims=.,:;/[]()!'@=\<> " %%i in (%*) do ( set n=%%i set n=!n:"=! echo.1 !n!>>tmp.txt ) if "%m%" "200" goto:add goto:loop endlocal :add :: /* 分类汇总 */ setlocal ENABLEDELAYEDEXPANSION for /f "tokens=1,2" %%i in ('sort tmp.txt^|findstr /r "^1\ [a-z][A- Z]"') do ( if /i "!y!" "%%j" ( set /a x+=1) else (if "!x!" neq "" ( if !x! lss 10 (echo.000!x! !y!>>tmp1.txt) else ( if !x! lss 100 (echo.00!x! !y!>>tmp1.txt) else ( if !x! lss 1000 (echo.0!x! !y!>>tmp1.txt)))) set y=%%j set x=%%i) ) if !x! lss 10 (echo.000!x! !y!>>tmp1.txt) else ( if !x! lss 100 (echo.00!x! !y!>>tmp1.txt) else ( if !x! lss 1000 (echo.0!x! !y!>>tmp1.txt))) endlocal sort /r tmp1.txt>tmp2.txt :ex :: /* 大写转小写 */ setlocal ENABLEDELAYEDEXPANSION for /f "delims=" %%i in (tmp2.txt) do ( set ex=%%i set ex=!ex:A=a! set ex=!ex:B=b! set ex=!ex:C=c! set ex=!ex:D=d! set ex=!ex:E=e! set ex=!ex:F=f! set ex=!ex:G=g! set ex=!ex:H=h! set ex=!ex:I=i! set ex=!ex:J=j! set ex=!ex:K=k! set ex=!ex:L=l! set ex=!ex:M=m! set ex=!ex:N=n! set ex=!ex:O=o! set ex=!ex:P=p! set ex=!ex:Q=q! set ex=!ex:R=r! set ex=!ex:S=s! set ex=!ex:T=t! set ex=!ex:U=u! set ex=!ex:V=v! set ex=!ex:W=w! set ex=!ex:X=x! set ex=!ex:Y=y! set ex=!ex:Z=z! echo.!ex!>>end.txt ) del tmp*.txt start end.txt :syntax cls echo. echo.word_num.cmd echo. echo.written by hitme 2005.9.2 echo.用法: echo.word_num 文件名 echo. echo.例如: echo.word_num License.txt echo. 统计中文字的,用法同顶楼,想 办法搞成竖排一列,试试 代码: @echo off setlocal ENABLEDELAYEDEXPANSION for /f "delims=" %%i in (%1) do ( set n=%%i echo.!n!>tmp.txt echo.x>>tmp.txt for /f "tokens=1 delims=:" %%a in ('findstr /o "x" tmp.txt') do set lenth=%%a for /l %%a in (0,1,!lenth!) do ( set m=!n:~%%a,1! if "!m!" neq "" echo.1 !m!>>tmp1.txt ) ) :add for /f "tokens=1,2" %%i in ('sort tmp1.txt') do ( if "!y!" "%%j" ( set /a x+=1) else ( if "!x!" neq "" ( if !x! lss 10 (echo.000!x! !y!>>tmp2.txt) else ( if !x! lss 100 (echo.00!x! !y!>>tmp2.txt) else ( if !x! lss 1000 (echo.0!x!
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] 下一页
hitme批处理集合