Practical vbs reminder Applet

Source: Internet
Author: User
Tags prefetch

Usage:
1. Set the following Code Save as: ring. vbs (the file name can be customized)
2. Move ring. vbs Program Start group, which can be automatically started with windows (location: start -- program -- start, and XP Startup Group location: C: \ Documents and Settings \ your USERNAME \ Start Menu \ Program \ Start \)
3. here I use the media player that comes with window to play music. So first open your Media Player and save "playing list" to D: \ music \ mymusic. WPL (the Save path can be customized, but you need to modify the strsoundfile path in the code below). You will be notified automatically after you turn on your computer!
Note: If you are using Winamp to play music, you must change the path to the Winamp playlist file address, and the strcommand and strcommand2 values are as follows:
Strcommand = "C: \ Program Files \ Winamp \ winamp.exe/prefetch: 1/task medialibrary" & CHR (34) & strsoundfile & CHR (34) 'play music
Strcommand2 = "taskkill/IM winamp.exe" 'Close the music program
'// Code starts
Set objshell = wscript. Createobject ("wscript. Shell ")
J = 60' working time (minutes)
N = 10' rest time (minutes)
Alerttext = "take a break and listen to music" & CHR (10) & "move your neck and waist. "& CHR (10) &" Life is sports !! "'Reminder content, CHR (10) is a line break
Alerttext2 = N & "it's time to rest and continue working! "
Strsoundfile = "D: \ music \ mymusic. WPL" 'automatic playback list address
Strcommand = "wmplayer.exe/prefetch: 1/task medialibrary" & CHR (34) & strsoundfile & CHR (34) 'play music
Strcommand2 = "taskkill/IM wmplayer.exe" 'Close the music program
For I = 1 to 12' 12 indicates the number of reminders.
Wscript. Sleep (1000*60 * j)
Msgbox alerttext, 64
Objshell. Run strcommand, 1, false
Wscript. Sleep (1000*60 * n)
Objshell. Run strcommand2, 0, true
Msgbox alerttext2, 64
Next
'// The End of the Code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.