完成代码,试验通过 ^-^
主程序:- @echo off
- setlocal enabledelayedexpansion&cls
- path=%path%;%~dp0.\网络;%~dp0.\command\第三方命令行程序;%~dp0.\command;%~dp0.\源码;%~dp0.\系统备份
- ::==============================================================
- :start
-
- call ASCII_Hex.bat %cd%
- set /p strHEX=<strHEX.txt
- echo %strHEX%
- set "strHEX=%strHEX:\=/%"
- reg add "HKEY_CURRENT_USER\00" /v AutoConfigURL /d file:^/^/^/"%strHEX%"/FuckGFW-FreeGate.pac /f
-
- ::==============================================================
- :end
- ENDLOCAL&echo 按任意键退出&pause>nul
- mode con cols=80 lines=25&color 07&graftabl 936>nul
- ::mode con cols=80 lines=30&color 07&graftabl 437>nul
- goto:eof
复制代码 函数程序:- ::BAT_NAME: ASCII_Hex.bat
- ::格式: call ASCII_Hex.bat %*
- ::返回值: strHEX.txt
- ::调用: call ASCII_Hex.bat %*
- :: set /p strHEX=<strHEX.txt
- :: echo %strHEX%
- @echo off
- setlocal enabledelayedexpansion&cls
- path=%path%;%~dp0.\网络;%~dp0.\command\第三方命令行程序;%~dp0.\command;%~dp0.\源码;%~dp0.\系统备份
- ::==============================================================
- set "_20= " &set "_38=8" &set "_50=P" &set "_68=h"
- set "_21=" &set "_39=9" &set "_51=Q" &set "_69=i"
- set "_22=" &set "_3A=:" &set "_52=R" &set "_6A=j"
- set "_23=#" &set "_3B=;" &set "_53=S" &set "_6B=k"
- set "_24=$" &set "_3C=<" &set "_54=T" &set "_6C=l"
- set "_25=%%" &set "_3D==" &set "_55=U" &set "_6D=m"
- set "_26=&" &set "_3E=>" &set "_56=V" &set "_6E=n"
- set "_27='" &set "_3F=?" &set "_57=W" &set "_6F=o"
- set "_28=(" &set "_40=@" &set "_58=X" &set "_70=p"
- set "_29=)" &set "_41=A" &set "_59=Y" &set "_71=q"
- set "_2A=*" &set "_42=B" &set "_5A=Z" &set "_72=r"
- set "_2B=+" &set "_43=C" &set "_5B=[" &set "_73=s"
- set "_2C=," &set "_44=D" &set "_5C=\" &set "_74=t"
- set "_2D=-" &set "_45=E" &set "_5D=]" &set "_75=u"
- set "_2E=." &set "_46=F" &set "_5E=^" &set "_76=v"
- set "_2F=/" &set "_47=G" &set "_5F=_" &set "_77=w"
- set "_30=0" &set "_48=H" &set "_60=`" &set "_78=x"
- set "_31=1" &set "_49=I" &set "_61=a" &set "_79=y"
- set "_32=2" &set "_4A=J" &set "_62=b" &set "_7A=z"
- set "_33=3" &set "_4B=K" &set "_63=c" &set "_7B={"
- set "_34=4" &set "_4C=L" &set "_64=d" &set "_7C=|"
- set "_35=5" &set "_4D=M" &set "_65=e" &set "_7D=}"
- set "_36=6" &set "_4E=N" &set "_66=f" &set "_7E=~"
- set "_37=7" &set "_4F=O" &set "_67=g" &set "_7F="
- ::==============================================================
- if not "%*"=="" (set "str=%*") else (set "str=G:\DOS\command\第三方命令行程序")
- call:strHEX %str%
- exit /b
- ::==============================================================
- :strHEX
- ::=======生成 HEX ASCII值=========
- echo %str%>1.txt
- for %%a in (1.txt) do set size=%%~za
- if "%size%"=="0" goto end
- fsutil file createnew 01.txt %size% >nul
- for /f "skip=1 tokens=2" %%a in ('fc /b 1.txt 01.txt') do (
- if "%%a"=="0D" goto next
- ::echo "!_%%a!"=="%%a"
- if not "!_%%a!"=="" (set "strHEX=!strHEX!!_%%a!") else (set "strHEX=!strHEX!%%%%a")
- )
- :next
- echo %strHEX%>strHEX.txt
- del 1.txt 01.txt
- goto:eof
- ::==============================================================
复制代码
[ 本帖最后由 hfg1977 于 2010-7-14 05:40 编辑 ] |