FileWatcher: Script to only send betwen 9am-5pm

Discuss our other products here. Get help with installation and running, notify us of bugs, request new features and enhancements.

Moderators: DataMystic Support, Moderators

User avatar
DataMystic Support
Site Admin
Posts: 2140
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia

FileWatcher: Script to only send betwen 9am-5pm

Postby DataMystic Support » Fri Aug 05, 2011 4:59 pm

This is a .vbs script - please save to a .vbs filename.

Code: Select all

Option Explicit

dim objArgs
dim filename
dim folder
dim WshShell

Function ExecuteWithTerminalOutput(cmd)
            Set WshShell = WScript.CreateObject("WScript.Shell")
            'use this line to hide the window, and wait until the new process finishes
            'useful for debugging
            WshShell.Run cmd, 1, true
            'use this line below when debugging is not needed
'            WshShell.Run cmd,0

            ExecuteWithTerminalOutput = 0
End Function

if Hour(Time) < 9 or Hour(Time) > 1800 then
  WScript.Quit 255
end if

'Set a reference to the arguments
Set objArgs = Wscript.Arguments
     for each filename in objArgs
           ExecuteWithTerminalOutput( "C:\WINDOWS\system32\cmd.exe /c S:\ISMS\DESOM\Xpedite\P6602R05.bat " + chr(34) + filename + chr(34) )
Set WshShell = Nothing
Set myRegExp = Nothing
Set objArgs = Nothing


Simon Carter, - Insulin dose calculator for Type 1 diabetes - 250,000 free software downloads - send huge email attachments

Return to “FileWatcher, DirDate and other Support”

Who is online

Users browsing this forum: No registered users and 1 guest