Click here to Skip to main content
13,297,878 members (45,934 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 29 Jun 2010

Day's Left Timer VBS

, 29 Jun 2010
Rate this:
Please Sign up or sign in to vote.
Day's Left Timer VBS Self Deleting

What It Does

It's a Visual Basic Script that lets System Administrators notify users of an upcoming event or change and how many days are left until the change. After it has hit zero days left, it deletes itself. This can be changed so it gives a second message before it deletes itself or launches other programs if required.

How To Use It

Place in start-up folder on Windows machines after modifying the message box and the eTime variable to what you want.


sTime = Date()
'Change date to what ever you want in MM/DD/YYYY format
eTime = "10/10/2010" 

call datediffToWords(sTime, eTime)
Function datediffToWords(d1, d2) 
	report = ""
 	days = DateDiff("d",d1,d2)
	report = days & " Day(s)"
	datediffToWords = report
	Msgbox "Message "& datediffToWords,4160,"Title"
	If datediffToWords = "0" & " Day(s)" Then
	End If
End Function 
Sub DeleteSelf()       
        Dim objFSO
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        objFSO.DeleteFile WScript.ScriptFullName
        Set objFSO = Nothing
End Sub 


To use in a web page, remove the messagebox and replace it with document.write and remove the DeleteSelf sub.


  • 29th June, 2010: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
emilio_grv27-Jun-10 7:40
memberemilio_grv27-Jun-10 7:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 29 Jun 2010
Article Copyright 2010 by crackruckles
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid