本帖最后由 cmd1152 于 2021-8-3 20:00 编辑
代码:- @echo off
- mode con cols=85 lines=301
- :i
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in (%~0) do (
- set tmp=%%i
- if "!tmp:~0,1!"=="." (
- set %%i
- )
- )
- cls
- if not "%.sm%"=="" (
- mode con cols=85 lines=302
- set "echa=echo 内容已被署名,禁止更改!署名:%.sm%"
- set "echb=pause"
- set "echc=exit"
- )
- set loop=1
- :in
- if %loop% lss 10 (set fz=00) else (
- if %loop% lss 100 (set fz=0) else (set "fz=")
- )
- echo;!fz!%loop%^|!.%fz%%loop%!
- if "%loop%"=="300" goto :okl
- set /a loop=loop+1
- goto :in
- :okl
- %echa%
- %echb%
- %echc%
- set ^/p gg^=输入要更改的行数,输入sm进行署名(比如001):
- if "%gg%"=="sm" goto :sm
- cls
- echo 请稍后...
- for /l %%i in (1,1,300) do (
- if %%i lss 10 (set fz=00) else (
- if %%i lss 100 (set fz=0) else (set "fz=")
- )
- if "!fz!%%i"=="!gg!" goto :y
- )
- echo 找不到'%gg%'
- pause
- goto :i
- :y
- cls
- echo 更改成什么,与右边最少要有一字节的空!
- set /p .%gg%=%gg%^|
- echo;.%gg%=!.%gg%!>>%~0
- goto :i
- :sm
- cls
- echo 警告:署名之后不允许更改,输入qx取消署名
- set /p sm=
- if "%sm%"=="qx" goto :i
- if "%sm%"=="" goto :sm
- echo;.sm=%sm%>>%~0
- goto :i
复制代码
|