China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-29 09:01
中国DOS联盟论坛 » 论坛回收站 » First time writing a batch script, everyone give some feedback, see if it can be improved View 1,945 Replies 8
Original Poster Posted 2009-06-25 14:27 ·  中国 山东 淄博 联通
新手上路
Credits 12
Posts 6
Joined 2009-06-23 13:11
17-year member
UID 147985
Gender Male
Status Offline
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
Floor 2 Posted 2009-06-25 14:29 ·  中国 山东 淄博 联通
新手上路
Credits 12
Posts 6
Joined 2009-06-23 13:11
17-year member
UID 147985
Gender Male
Status Offline
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
Floor 3 Posted 2009-06-25 14:30 ·  中国 广西 南宁 电信
初级用户
★★
Credits 172
Posts 52
Joined 2005-03-29 00:00
21-year member
UID 37565
Gender Male
Status Offline
Haha, interesting!!! But if your wife closes the window, wouldn't it not shut down?
Floor 4 Posted 2009-06-25 14:32 ·  中国 广西 南宁 电信
初级用户
★★
Credits 172
Posts 52
Joined 2005-03-29 00:00
21-year member
UID 37565
Gender Male
Status Offline
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.
Floor 5 Posted 2009-06-25 14:39 ·  中国 山东 淄博 联通
新手上路
Credits 12
Posts 6
Joined 2009-06-23 13:11
17-year member
UID 147985
Gender Male
Status Offline
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.
Floor 6 Posted 2009-06-25 14:59 ·  中国 广西 南宁 电信
初级用户
★★
Credits 172
Posts 52
Joined 2005-03-29 00:00
21-year member
UID 37565
Gender Male
Status Offline
You can turn it off with commands
Floor 7 Posted 2009-06-25 15:35 ·  中国 山东 淄博 联通
新手上路
Credits 12
Posts 6
Joined 2009-06-23 13:11
17-year member
UID 147985
Gender Male
Status Offline
Oh, what a bummer!~ If she could use commands, then all my efforts would have been in vain.
Floor 8 Posted 2009-06-25 19:44 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
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.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 9 Posted 2009-06-25 21:45 ·  中国 安徽 马鞍山 联通
初级用户
Credits 169
Posts 32
Joined 2002-10-20 00:00
23-year member
UID 26
Gender Male
Status Offline
Install the government-free Green Dam. Hehe.
GGhost一键恢复
http://gghost.uueasy.com
Forum Jump: