Microsoft

Tech Tip: Empty the Documents folder/Receive an e-mail when a service fails

Learn how to clean out the Start menu's Documents folder, and find out to configure Windows to send you an e-mail notification if the service goes down.

Empty the Start menu's Documents folder at shutdown

Windows 2000's Start menu includes a Documents folder that displays recent files. Listing these documents on the Start menu makes it easy to access recently and frequently used files. In some situations, however, you might not want Windows to display this document list for security or privacy reasons.

If you just want to remove a few documents from the list, you can right-click each document in the Documents menu, and choose Delete. Windows deletes the shortcut to the document, but it doesn't delete the document itself.

In addition, a couple of group policy settings exist that you can use to control how Windows handles document history. To set these policies at the local computer, go to Start | Run, enter GPEDIT.MSC in the Open text box of the Run dialog box, and click OK.

If you want to see the document history within the current session but don't want the history saved between sessions, go to User Configuration | Administrative Templates | Start Menu And Taskbar, and enable the Clear History Of Recently Opened Documents On Exit group policy. To prevent Windows from adding the documents to the Start menu at all, enable the Do Not Keep History Of Recently Opened Documents policy.

Receive an e-mail notification when a service goes down

Sooner or later, whether you're troubleshooting a server or just managing one, knowing when a particular service goes down can be a real lifesaver. Early notification can help you recognize that a problem has occurred so you can get to work on the problem as soon as possible to minimize disruption to users and/or customers.

A service's properties provide a handful of recovery options. To view these properties, open the Services console, double-click a service, and select the Recovery tab.

The Recovery tab sports three drop-down lists that let you specify which action Windows should take, if any, when the service fails the first, second, and subsequent times.

For example, you can configure Windows to send you an e-mail notification if the service goes down. To do so, create the following script using Notepad:

set objArgs = Wscript.Arguments
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "adminaddress@yourdomain.tld"
objEmail.To = "youraddress@yourdomain.tld"
objEmail.Subject = objArgs(0) & " service is down"
objEmail.Textbody = "The service " & objArgs(0) & " has failed."
objEmail.Send
set objArgs = nothing
set objEmail = nothing

Save the script as Mail.vbs, and open the properties for the service from the Services console. In one of the three drop-down lists, choose the Run A File option. Click Browse to navigate to the Mail.vbs script you just created. In the Command Line Parameters field, enter the service name (without spaces) that you want passed to the script, and click OK.

Editor's Picks

Free Newsletters, In your Inbox