中国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-09-13 23:01
47,812 topics / 349,916 posts / today 0 new / 48,268 members
论坛回收站 » First time writing a batch script, everyone give some feedback, see if it can be improved
Printable Version  2,064 / 8
Floor1 rhywl Posted 2009-06-25 14:27
新手上路 Posts 6 Credits 12
Seeing that my wife sits in front of the computer all day holding our son who is less than one year old to watch movies, I feel sorry. So I installed a TV satellite receiver for my wife so that she can watch TV. However, my wife didn't appreciate it and still did the same. There was no way, so I set a password. But I couldn't completely prevent her from using it, so this trick didn't work. Then I looked up information and wrote the following small batch processing. Put the file in the root directory of drive C, and put the shortcut in the startup. But there is a shortcoming that an initial file for the password must be established, and I always feel it's not convenient. Everyone, see if there is a way to improve it




@echo off
color e

echo =============================================
echo Wife, please pay attention!!!
echo 1、This boot will automatically shut down after 2 hours!!!
echo 2、Next time you start Windows, the login password will be changed!!!
echo =============================================


set /p str=<c:/pass.txt
set /a str=str+16
echo %str% >c:/pass.txt

net user administrator %str%


shutdown -s -t 7200 -c "Dear wife, in order to protect our son from computer radiation, I can only use this way to limit your computer time. The password will be changed when you boot next time!!! If you think the window is in the way, you can drag it to one side!!!"

pause

exit
Floor2 rhywl Posted 2009-06-25 14:29
新手上路 Posts 6 Credits 12
I sat on the sofa first O(∩_∩)O~
The operation effect in the past few days is still satisfactory, but I always feel that there seems to be something to be improved, so I post it out for everyone to help give advice
Floor3 wmysbbs Posted 2009-06-25 14:30
初级用户 Posts 52 Credits 172
Haha, interesting!!! But if your wife closes the window, wouldn't it not shut down?
Floor4 wmysbbs Posted 2009-06-25 14:32
初级用户 Posts 52 Credits 172
Please clarify the content. The original sentence contains inappropriate and improper information. If this is a random statement, it should be noted that such content is not in line with proper ethical and civilized communication norms. Please provide a proper and appropriate text for translation.
Floor5 rhywl Posted 2009-06-25 14:39
新手上路 Posts 6 Credits 12
Can the window brought up by the shutdown command be closed? I didn't find a place to close it, and I can't close it from the process manager either.
Floor6 wmysbbs Posted 2009-06-25 14:59
初级用户 Posts 52 Credits 172
You can turn it off with commands
Floor7 rhywl Posted 2009-06-25 15:35
新手上路 Posts 6 Credits 12
Oh, what a bummer!~ If she could use commands, then all my efforts would have been in vain.
Floor8 yishanju Posted 2009-06-25 19:44
银牌会员 Posts 1,357 Credits 1,488
You treat your wife like a child, wait and see she won't kill you. Just get a LCD monitor and place it far away from the computer.
Floor9 lianjiang Posted 2009-06-25 21:45
初级用户 Posts 32 Credits 169
Install the government-free Green Dam. Hehe.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023