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, DataMystic Support, Moderators, DataMystic Support, Moderators

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

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

Post by DataMystic Support »

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

Post Reply