Yep, it's an easy fix
##
# added -constrain directive
{
-name Net Stop Websense and SQL Server
-start -time 03:00:00 AM
-constrain 0 0 5 0-command -wait net stop WebsenseLogScheduler /y
-command -wait net stop WebsenseLogServer /y
-command -wait net stop mssqlserver /y
-command -wait net stop mssql$production /y
-command shutdown.exe /R /L /Y
-action -print Shutting Down Server
-start -inc 1 0 0 0
}
The
-constrain directive tells WinCron to constrain it's execution to a 'time window'.
In the above example I've set that time window to 5 minutes.
You also need to move the -inc directive to the start line as well.
(gets rid of the second start command.)
Like this:##
# added -constrain directive and fixed -inc directive
{
-name Net Stop Websense and SQL Server
-start -time 03:00:00 AM -constrain 0 0 5 0
-inc 1 0 0 0-command -wait net stop WebsenseLogScheduler /y
-command -wait net stop WebsenseLogServer /y
-command -wait net stop mssqlserver /y
-command -wait net stop mssql$production /y
-command shutdown.exe /R /L /Y
-action -print Shutting Down Server
}