中国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-03 12:52
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » Pop up a prompt after the specified time
Printable Version  2,584 / 18
Floor1 junyee Posted 2006-12-25 11:32
中级用户 Posts 112 Credits 253
I want to write something to achieve the following effects
After running /
Requires entering a time (a, unit: hours),
After entering, a pop-up window "The online time you set is a hours!" pops up
This pop-up window hides by itself after 3 seconds!
A prompt pops up every 15 minutes: Protect your eyes! The prompt box disappears after 15 seconds~
Then when the time (a) you just entered is about to reach (for example, if you enter 1, it is at 59 minutes), prompt "The time you limited has arrived! Please be ready to log off!" (Preferably, a countdown can be displayed at the same time! 60-59-58...1-0)
When the countdown is 0 (that is, the entered time a arrives), run a certain program!

It should be achievable with vbs? But I don't understand, and I only have a slight understanding of bat~ If it can be written with bat, it would be better^_^~~
I also posted a request in this forum, but the answers received are not many~ Alas.

Preferably, no third-party software is used~~ I have searched online many times, and there are few that can really satisfy. I want to implement something that everyone can use!
The purpose of making this thing is obvious, which is to remind some people who use the computer frequently! Pay attention to their own health!
I myself have caused high myopia now because I didn't pay attention to eye-related issues and faced the monitor for a long time!
It's too late to regret! I can only hope that a certain expert can write such a thing.
Put this thing in the Internet cafe, so that (or urge) each online user can develop a good eye care habit!
Wish every computer enthusiast, while enjoying the joy brought by the computer, can always have a pair of bright eyes!

Merry Christmas~~~~~~

Hoping!
Floor2 lotus516 Posted 2006-12-25 13:51
高级用户 Posts 246 Credits 551
I made a batch, the code is a bit messy!! But it's okay!!! I don't have much time and didn't test it for an hour!!! You test it yourself!!!!
First sofa!! Hehe!!!

The sleep software has accurate time (millisecond level)!! The memory usage is not much!!! (388k)
A small drawback must be an integer hour!!!
The sleep must be in the same folder as the batch, otherwise the sleep in the code should be changed to the specific path!! Such as d:\sleep.exe
Corrected a few serious errors!!
If the owner needs it, change exit to the program you want to run!!!

[ Last edited by lotus516 on 2006-12-25 at 03:47 PM ]
Floor3 win2ye Posted 2006-12-25 22:15
初级用户 Posts 22 Credits 58
Learning

Still need external commands

But it's difficult to make BAT use internal commands to achieve the effect!
Floor4 jmz573515 Posted 2006-12-25 22:39
银牌会员 Posts 464 Credits 1,212
I think maybe I can call the shutdown command.
Floor5 vlanmaster Posted 2006-12-25 23:27
初级用户 Posts 46 Credits 100
But shutdown seems to require administrator privileges. Otherwise, it can't be executed.
Floor6 voiL Posted 2006-12-25 23:47
中级用户 Posts 189 Credits 384
It might be a bit difficult if you're not an administrator...

Also, what is the operating environment of the original poster??????........
Floor7 everest79 Posted 2006-12-25 23:54
金牌会员 Posts 1,127 Credits 2,564
Can timing be done in a special way?

Flexibly use ping -w [ms] -n 1 non - existent IP
For example, ping -n 1 -w 1000 1.255
Floor8 lcazhj Posted 2006-12-26 00:21
初级用户 Posts 20 Credits 51
Floor9 lotus516 Posted 2006-12-26 07:17
高级用户 Posts 246 Credits 551
Originally posted by everest79 at 2006-12-25 23:54:
Can timing be done in a special way?

Flexibly use ping -w -n 1 non-existent IP
For example, ping -n 1 -w 1000 1.255

It's not that it can't be done, but the precision is not high. The owner has high requirements, and ping won't work!!
Are there any more ingenious techniques for batch processing delays?http://www.cn-dos.net/forum/viewthread.php?tid=23475&fpage=1&highlight=%E6%89%B9%E5%A4%84%E7%90%86%E5%BB%B6%E6%97%B6%E8%BF%98%E6%9C%89%E4%BB%80%E4%B9%88%E7%B2%BE%E5%B7%A7%E7%82%B9%E7%9A%84%E6%8A%80%E5%B7%A7%E5%90%97%EF%BC%9F
Floor10 junyee Posted 2006-12-26 08:13
中级用户 Posts 112 Credits 253
Operation failed!

Prompt: Error 1702 when getting the session name

This is the problem I encountered when running...
windows xp sp2

Also, can you write a vbs to achieve the above function.
Brother lotus516's code didn't test successfully. I don't know if there will be a command prompt window in the taskbar after running??
I think the best code written should not have any things appear in the taskbar after running~~vbs should be able to achieve that, right?
Floor11 lotus516 Posted 2006-12-26 09:28
高级用户 Posts 246 Credits 551
Originally posted by junyee at 2006-12-26 08:13:
Run failed!

Prompt: Error 1702 when getting session name

This is the problem I encountered when running...
Windows XP SP2

Also, can a VBS be written to achieve the above function.
Brother lotus516's ...

I can do it without SP2! There are windows in the taskbar, but VBS can't make windows. But I just can't figure out how to make the window! Also, it can be made into a service to eliminate the window!

[ Last edited by lotus516 on 2006-12-26 at 09:35 AM ]
Floor12 junyee Posted 2006-12-26 10:34
中级用户 Posts 112 Credits 253
, thank you in advance...
There are many VBS experts in the forum~~~Come and help!
Floor13 jmz573515 Posted 2006-12-26 12:03
银牌会员 Posts 464 Credits 1,212
Roughly written one, not tested. For reference only. (The time cannot be as accurate as you said, some functions cannot be realized)



[ Last edited by jmz573515 on 2006-12-26 at 09:49 AM ]
Floor14 slore Posted 2007-02-12 14:36
铂金会员 Posts 2,478 Credits 5,212
Using the at command

c:\>at /?
The AT command schedules commands and programs to run at a specific date and time.
To use the AT command, the Schedule Service must be running.
Floor15 anqing Posted 2007-02-12 22:13
高级用户 Posts 413 Credits 859
The VBScript on floor 13 pops up a prompt at the 16th minute, and the test is okay. But the prompt when the final time is up is not implemented?
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023