Hi K,
I want this command " copy *.log d:\log " to run in batch file from 10:00am to 1:00pm and from monday to friday. Once this time is over the batch file keep monitoring time to re-start this copy command when it comes in the specified time period.
Thanks in advance
Run command in specified time period
Moderator: DosItHelp
Re: Run command in specified time period
☺
You can use the sheduler to do this:
or
Beware though, both methods have their advantages and disadvantages
If you are writing a 'smart' batch, these system variables could be helpfull:
You can use the sheduler to do this:
Code: Select all
schtasks /?
Code: Select all
at /?
Code: Select all
set "FullPath.SOURCE=!FullPath.PRGM3TH!\SYS\CFG\SchTasks"
set "?=1sthMonth.CMD" &set /p "?= :/ !?! "<nul
::(
at 00:00 /interactive /every:1 "!FullPath.SOURCE!\!?!"
::)
set "?=Saturday.CMD" &set /p "?= :/ !?! "<nul
::(
at 00:00 /interactive /every:za "!FullPath.SOURCE!\!?!"
::)
Code: Select all
echo.%DATE%
echo.%TIME%
Re: Run command in specified time period
Actually windows or dos Scheduler task running is not good for my situation. I want to check Time and run command or else. check this below example batch file code the end IF line i need to work out in dos language.
Example;
======================================================================
:RunMycommands
copy *.log d:\
ren *.log a.txt
etc....
:Loop
If time greater than 8:00 and less than 16:00 then Goto RunMyCommands Else Goto Loop
======================================================================
the commands i want to run continuously once after they finish and during all day in the specified time.
Example;
======================================================================
:RunMycommands
copy *.log d:\
ren *.log a.txt
etc....
:Loop
If time greater than 8:00 and less than 16:00 then Goto RunMyCommands Else Goto Loop
======================================================================
the commands i want to run continuously once after they finish and during all day in the specified time.