WSH FAQ Part 2

Alex Angelopoulos (aka at mvps dot org)

How do I schedule WSH scripts with the AT command?

The MSKB article Q191430 - HOWTO: Run a WSH File from NT Scheduler describes this.  Four points worth noting:

Below is an example of a correctly formed AT directive:

AT 16:00:00 /interactive "c:\winnt\samples\wsh\excel.vbs"

Is it necessary to explicitly set objects to nothing in my code?

Object references are implicitly set to Nothing when they go out of scope.  Many consider it good practive to set object references to Nothing explicitly, but it isn't strictly required.  The VBScript engine will cleanup if you don't. - Michael Harris

How do I refresh the desktop with WSH?

From a post by spag found on Google:

 In Windows 9x that would be:

WshShell.Run"C:\WINDOWS\RUNDLL.EXE user,RepaintScreen"

In XP/2k you can try:

Set WApp = CreateObject("Shell.Application")
WApp.Namespace(0).Self.InvokeVerb "Refresh"