FileWatcher: Script to only send betwen 9am-5pm
Posted: 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) )
next
Set WshShell = Nothing
Set myRegExp = Nothing
Set objArgs = Nothing