![]() |
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-08 16:15 |
47,811 topics / 349,895 posts / today 0 new / 48,253 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] Anti-addiction system in a pure batch file under the CMD environment |
| Printable Version 2,124 / 19 |
| Floor1 chishingchan | Posted 2008-04-07 11:27 |
| 银牌会员 Posts 538 Credits 1,284 | |
|
Explanation:
Now games are mostly played under an XP environment, so this is called the CMD environment; Pure batch means trying not to require third-party software support, but if there is really no way, then I’ll have to use it too; An anti-addiction system means controlling computer usage across multiple time periods, whether programs, games, websites, etc. Reason: Computers are very common now, and many teenagers (the school-going kind) always play games day and night, affecting their studies. It not only affects studies, but also affects health. I’m not cut out for programming myself, so... Reference: Computer News 2006 bound volume, page 242: “Anti-addiction tricks for computers - cleverly using ‘Scheduled Tasks’ to manage boot time”, but I still think it’s not ideal: 1. too many batch files; 2. scheduled tasks are easy to discover; 3. some functions are still lacking. Help requirements: 1. Generate a single batch file (it can run in multi-parameter form), and make it run hidden or as a service. 2. Monitor malicious changes to the system time (it may require using a log file for time comparison) 3. When not connected to the network, handle things according to system time; when connected, support synchronizing with the time of some server on the network: The system must have the Windows Time (W32Time) service, set to automatic net time /setsntp:time.jmu.edu.cn ;set the time server address net stop w32time ;stop the time service net start w32time ;start the time service w32tm -s ;synchronize time immediately 4. Support multiple time periods, for example: allow computer use from 9:30-11:30, 15:00-17:00, 19:00-21:00, and automatically shut down at all other times; 5. Support setting certain programs (including games), websites, etc. as forbidden to run Because there are too many functions, if anyone feels they can’t handle all of them, replying with just a single function is also fine. Many thanks! |
|
| Floor2 knightak | Posted 2008-04-07 15:32 |
| 初级用户 Posts 17 Credits 35 | |
|
Pure command-line batch processing probably can’t achieve all the functions you mentioned, unless outside tools are brought in.
With so many requirements, you’d better find a software company to do it for you. The forum is for answering questions and clearing up doubts, not for helping people do projects. ....................BTW: if someone’s stuff gets taken by you and sold, that would really be something to watch. |
|
| Floor3 knightak | Posted 2008-04-07 15:34 |
| 初级用户 Posts 17 Credits 35 | |
|
Try to start from education; that’s best for the child.
What you’re doing should count as violent interference. Education should still be education, hehe. |
|
| Floor4 zh159 | Posted 2008-04-07 16:15 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
Seriously, OP, I really want to take a handgun and wipe out those American aircraft carriers.
|
|
| Floor5 voiL | Posted 2008-04-07 19:11 |
| 中级用户 Posts 189 Credits 384 | |
|
I wrote this before. But because the hard drive died, it was lost too. Right now I don’t have the time or the energy to write it again, so I hope brothers on the forum can improve it a bit.
I wrote most of the functions the OP mentioned. You can search the posts I made before; putting them together should be close enough. As for passwords, you can use MD5.exe to encrypt, then use the setx.vbs written in VBS that brother est posted to write it into system or user variables. You can also use system time to generate a password that changes according to the time. As for time (CMD is ineffective on numbers like 8 and 9), you can refer to the small Scheduled Tasks program posted by jastyg http://www.cn-dos.net/forum/viewthread.php?tid=21110 For time synchronization, you can refer to this http://www.cn-dos.net/forum/viewthread.php?tid=17659 setx.vbs http://www.cn-dos.net/forum/viewthread.php?tid=27952 |
|
| Floor6 chishingchan | Posted 2008-04-07 21:50 |
| 银牌会员 Posts 538 Credits 1,284 | |
|
The reply in post #5 looks more decent. I’ll use it for reference. Looks like there’s no real help to be had, so I can only try making it myself!
|
|
| Floor7 lotus516 | Posted 2008-04-08 00:46 |
| 高级用户 Posts 246 Credits 551 | |
|
OP’s requirements are very easy to achieve!
1. You can hide it with VBS 2. Use Group Policy to prohibit changing the time 3. With #2, there’s no need to sync the time online 4. shutdown -f -s -t 0 is enough to shut down. Here’s a reference: 930 and 1000 mean 9:30--10:00. As for the VBS in that line, search for it on this forum; if it’s not called 共用2, that’s the one. Of course, this one is optional—you can change it to a forced one with no choice, so when the time comes it must shut down! 5. Programs can be blocked, but a certain website is hard to deal with!! |
|
| Floor8 slore | Posted 2008-04-08 03:01 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
They’re all fairly easy to achieve, feels like manual labor, so I give up~
A line of thought for you: 5. To forbid programs, use image hijacking To forbid websites, use HOSTS |
|
| Floor9 chishingchan | Posted 2008-04-08 11:15 |
| 银牌会员 Posts 538 Credits 1,284 | |
|
Thanks to post #7. I’m not familiar with VBS, so I’ll still learn to write batch files myself, and ask again if I don’t understand. I once made a system file redirection program the same way.
Because my memory isn’t too good, although I know the purpose of many commands, when actually using them I still have to check the help or refer to other people’s examples. |
|
| Floor10 lotus516 | Posted 2008-04-08 13:24 |
| 高级用户 Posts 246 Credits 551 | |
|
I’m not telling you to do VBS programming, just to use VBS to start the batch file, then it can be hidden!!
Actually I have 1 and 4 of your requirements, but I’d rather you write them yourself, that’s also good for you. You already wrote 3, so I won’t say more, and I don’t use that anyway! As for 2, apart from being easy to handle in Group Policy, the rest aren’t very good, because as long as the user knows you have such a program, they can change the time in the BIOS!! [ Last edited by lotus516 on 2008-4-8 at 01:34 PM ] |
|
| Floor11 lotus516 | Posted 2008-04-08 13:29 |
| 高级用户 Posts 246 Credits 551 | |
|
For VBS see this posthttp://www.cn-dos.net/forum/viewthread.php?tid=26132&fpage=1&highlight=%E8%BF%94%E5%9B%9E
For forced choice, remove the NO from this line! intAnswer = MsgBox("Without this setting it can only be done in Safe Mode. Continue? ", vbExclamation + vbYesNo, "Little Dot Prompt!") |
|
| Floor12 chishingchan | Posted 2008-04-08 22:35 |
| 银牌会员 Posts 538 Credits 1,284 | |
|
No choice, I can only do it step by step. First I’ll handle time logging and time encryption:
The following batch file generates a text file named datetime.log (see the quoted part). This string is arranged like this: run time, random password, first period start, first period end, second period start, second period end, third period start, third period end Each of the time periods above is written into the datetime.log file after adding the random password. Below is the execution result of the batch file. The execution result on every machine will be absolutely different from the data below. Encrypted text: 22154011121111121124121151121181121211121231121 Now here comes the problem: Because the recorded time periods are all 6 digits, if I need to handle times before 10 o’clock, how should I properly handle the addition and subtraction, since this 6-digit number has a leading 0? Besides, these times still need to be written into the datetime.log file in 6-digit form. How should this be improved? [ Last edited by chishingchan on 2008-4-8 at 10:42 PM ] |
|
| Floor13 chishingchan | Posted 2008-04-08 22:48 |
| 银牌会员 Posts 538 Credits 1,284 | |
|
I’ve thought about this problem: add 1000000 to the time. No matter if the time is 00:00:00, that 00:00:00 would then need special handling as =1000000, or add 1 second to every time, and for times before 10 o’clock add another 1000000, then subtract back out the 1000000 when processing. I don’t know whether that would be good or not?
|
|
| Floor14 chishingchan | Posted 2008-04-08 22:54 |
| 银牌会员 Posts 538 Credits 1,284 | |
|
I do have a way to handle hiding. As for using service mode, there is something on this forum, but I haven’t studied it. But that part can be dealt with later.
The core is setting, checking, handling, and other time-related issues. |
|
| Floor15 chishingchan | Posted 2008-04-09 14:00 |
| 银牌会员 Posts 538 Credits 1,284 | |
|
It would be good if everyone could give some opinions too, help out a bit!
|
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |