本帖最后由 cmd1152 于 2021-7-20 22:36 编辑
我闲着无聊,自己写了个批处理损坏器,其实可以允许空格的,但我不想做。废话不多说上代码!- @echo off
- mode con cols=95 lines=43
- title Made By 1152
- setlocal enabledelayedexpansion
- :i
- cls
- set /p sh=要损坏的批处理(不允许空格)=
- if "%sh%"=="" goto :i
- if /i "%sh:~-4%"==".bat" goto :y
- if /i "%sh:~-4%"==".cmd" goto :y
- goto :i
- :y
- cls
- echo;要损坏的批处理=%sh%
- echo;
- echo;╔════╗
- echo;║损坏方法║
- echo;╚╦═══╝
- echo; ║
- echo; ║ ╔════╗
- echo; ╠═╣注释损坏║
- echo; ║ ╚╦═══╝
- echo; ║ ║
- echo; ║ ║ ╔══════╗
- echo; ║ ╠═╣1.“::”损坏║
- echo; ║ ║ ╚══════╝
- echo; ║ ║
- echo; ║ ║ ╔═══════╗
- echo; ║ ╚═╣2.“rem ”损坏║
- echo; ║ ╚═══════╝
- echo; ║
- echo; ║ ╔════╗
- echo; ╠═╣参数损坏║
- echo; ║ ╚╦═══╝
- echo; ║ ║
- echo; ║ ║ ╔══════╗
- echo; ║ ╠═╣3.“%%%%”损坏║
- echo; ║ ║ ╚══════╝
- echo; ║ ║
- echo; ║ ║ ╔═══════════════════════════════════╗
- echo; ║ ╚═╣×.“感叹号”损坏(无法使用,因为本程序已经开启 enabledelayedexpansion)║
- echo; ║ ╚═══════════════════════════════════╝
- echo; ║
- echo; ║ ╔══════════╗
- echo; ╚═╣直接关闭(停止或出错)║
- echo; ╚╦═════════╝
- echo; ║
- echo; ║ ╔═══════╗
- echo; ╠═╣5.“exit”损坏║
- echo; ║ ╚═══════╝
- echo; ║
- echo; ║ ╔═══════╗
- echo; ╚═╣6.“goto”损坏║
- echo; ╚═══════╝
- echo;
- set /p xz=我选择
- if "%xz%"=="1" (
- (FOR /F "delims=" %%i in (%sh%) do (echo;::%%i>!sh!.tmp))
- (FOR /F "delims=" %%i in (%sh%.tmp) do (echo;%%i>!sh!))
- goto :endd
- )
- if "%xz%"=="2" (
- (FOR /F "delims=" %%i in (%sh%) do (echo;rem %%i>!sh!.tmp))
- (FOR /F "delims=" %%i in (%sh%.tmp) do (echo;%%i>!sh!))
- goto :endd
- )
- if "%xz%"=="3" (
- (FOR /F "delims=" %%i in (%sh%) do (echo;%% %%i %%>!sh!.tmp))
- (FOR /F "delims=" %%i in (%sh%.tmp) do (echo;%%i>!sh!))
- goto :endd
- )
- if "%xz%"=="5" (
- (FOR /F "delims=" %%i in (%sh%) do (echo;%%i>!sh!.tmp))
- echo;exit>%sh%
- (FOR /F "delims=" %%i in (%sh%.tmp) do (echo;%%i>>!sh!))
- goto :endd
- )
- if "%xz%"=="6" (
- (FOR /F "delims=" %%i in (%sh%) do (echo;%%i>!sh!.tmp))
- echo;goto :%RANDOM%>%sh%
- (FOR /F "delims=" %%i in (%sh%.tmp) do (echo;%%i>>!sh!))
- goto :endd
- )
- goto :y
- :endd
- cls
- echo 已损坏!
- del %sh%.tmp >nul 2>nul
- pause
- goto :i
复制代码
|