A small alarm clock for scheduled tasks based on windows

Source: Internet
Author: User
Tags schtasks

A small alarm clock for scheduled tasks based on windows

Recently, my work is busy, and my girlfriend is inevitably neglected. So I wrote a small program to remind her to go to bed.

I used bat to write the original function. The Code is as follows:

@ Echo off
Title % date % time :~, 8%
Mshta vbscript: msgbox ("Yang huaqiu! Sleeping! ", 36," said the broken master: ") (window. close)
Mshta vbscript: msgbox ("Yang huaqiu! Take medicine! ", 36," said the broken master: ") (window. close)

Mshta is used to call code in other languages in batch processing. Here I use it to call the msgbox function in vbs to generate a pop-up dialog box.

The cmd dialog box is displayed during the bat operation, which is unfriendly. I use a vbs program to call it:

Set ws = wscript. createobject ("wscript. shell ")
Ws. run "D: intimate small alarm Alarm 1.0 \ small alarm 1.0.bat/start", 0

Save it as a vbs file. 0 indicates hiding the window.

I need more features. For example, my girlfriend and I fell in love with each other in July 13 this year. I hope to make a simple statistics.

I found it difficult for bat to implement this function, but vbs can easily:

Dim
A = datevalue ("2014-7-13 ")
Msgbox "dear fish swap, now it's" & now & + vbCrLf ++ vbCrLf + "Master Broken has accompanied you" & datediff ("d", a, now) & "days ~, Continue to work! "," Said the broken master :"

The datediff function is used to return the time interval between two dates.

I hope that the small alarm clock can run at every day, and the statistical program will run at every startup. So I wrote such a batch:

Mkdir D: \ small intimate alarm clock 1.0
Copy "alert clock 1.0.bat" "D: Alert clock 1.0 \ alert clock 1.0.bat"
Copy "VBS call. vbs" "D: intimate small Alarm 1.0 \ VBS call. vbs"
Copy "Cute master fragment. vbs" "D: intimate small alarm clock 1.0 \ cute master fragment. vbs"

Schtasks/create/tn "Cute master fragment"/tr d: \ intimate small alarm clock 1.0 \ cute master fragment. vbs/SC onlogon
Schtasks/create/tn "intimate alert Clock"/tr d: \ intimate alert clock 1.0 \ VBS call. vbs/SC daily/st 23:00:00/ed

Pause

The role of this bat is obvious. After execution, it creates a folder on disk D and copies the three subprograms. Then, use shctasks to create a scheduled task and specify the start time.

Onlogon is started every time you log on. I tried to use onstart, and the effect was unsatisfactory.

SC daily/st 23:00:00/ed 2014/12/31 indicates that the service is started at every day and the plan continues.

Such a warm and small alarm clock is ready.


Is there a small alarm on windows?

Wenwen848985 hello!

Schedule a task.

Select a music to play at a specific time, that is, the alarm clock effect.

The scheduled task is in the control panel.

Start --- set --- Control Panel

Success !!

Can I set an alarm for scheduled tasks in windows?

There is a task plan in the control panel, where you can set

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.