Is there a way to set up a task so that it runs once a day? I set up a task
to run at 6:00 A.M. daily, but if I'm not using the computer at that time
the task doesn't run when I do turn the computer on. In Vista there's an
option to run the task as soon as possible if a scheduled start is missed.
"Mark" <secureourborders@hotmail.com> wrote in message
news:uGzpZECtIHA.2292@TK2MSFTNGP03.phx.gbl...
> Is there a way to set up a task so that it runs once a day? I set up a
> task to run at 6:00 A.M. daily, but if I'm not using the computer at that
> time the task doesn't run when I do turn the computer on. In Vista there's
> an option to run the task as soon as possible if a scheduled start is
> missed.
>
> Thanks
> Mark
You could invoke a batch file via the Task Scheduler once
every 10 minutes. It would run schtasks.exe to check if your
task had run today, and if it had not, launch it right now.
Can you explain how to set up and run this batch file? The program I want to
run is "SysRestorePoint.exe". Every 30 minutes is probably sufficient.
Thanks
"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:OwS3xqCtIHA.1240@TK2MSFTNGP02.phx.gbl...
>
> "Mark" <secureourborders@hotmail.com> wrote in message
> news:uGzpZECtIHA.2292@TK2MSFTNGP03.phx.gbl...
>> Is there a way to set up a task so that it runs once a day? I set up a
>> task to run at 6:00 A.M. daily, but if I'm not using the computer at that
>> time the task doesn't run when I do turn the computer on. In Vista
>> there's an option to run the task as soon as possible if a scheduled
>> start is missed.
>>
>> Thanks
>> Mark
>
> You could invoke a batch file via the Task Scheduler once
> every 10 minutes. It would run schtasks.exe to check if your
> task had run today, and if it had not, launch it right now.
>
> Post again if you require more details.
>
>
"Mark" <secureourborders@hotmail.com> wrote in message
news:%23YyW%235CtIHA.3680@TK2MSFTNGP05.phx.gbl...
> Can you explain how to set up and run this batch file? The program I want
> to run is "SysRestorePoint.exe". Every 30 minutes is probably sufficient.
>
> Thanks
I changed my mind: Rather than checking the time when the
task ran last time round, I'm now using a semaphore file. This
approach requires much less code.
Copy & past the code below into a batch file of your choice,
fix up the wrapped lines, remove the line numbers and set
the correct path for your application in Line 07. Now use
the Task Scheduler to run this batch file once every 30 minutes.
You will find that SysRestorePoint.exe will run just once
every day.
01. @echo off
02. set LogDir=c:\Logs
03. set LogFile=%LogDir%\Semaphore.txt
04. if not exist "%LogDir%" md "%LogDir%"
05. robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" || goto
:eof
06. echo Application last run on %Date% at %Time% > "%LogFile%"
07. "c:\Program Files\Your App\SysRestorePoint.exe"
You can download robocopy.exe from the Windows
Resource Kit.
Should it look like this? I downloaded robycopy gui, not sure what to do
with. I saved as .bat. I don't think I did it right because when I clicked
on the file the program didn't run. This may be over my head.
Thanks
@echo off
set LogDir=c:\Logs
set LogFile=%LogDir%\Semaphore.txt
if not exist "%LogDir%" md "%LogDir%"
robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" || goto
echo Application last run on %Date% at %Time% > "%LogFile%"
"C:\Documents and Settings\Mark\Desktop\SysRestorePoint.exe"
"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:%23wejGjDtIHA.2208@TK2MSFTNGP04.phx.gbl...
>
> "Mark" <secureourborders@hotmail.com> wrote in message
> news:%23YyW%235CtIHA.3680@TK2MSFTNGP05.phx.gbl...
>> Can you explain how to set up and run this batch file? The program I want
>> to run is "SysRestorePoint.exe". Every 30 minutes is probably sufficient.
>>
>> Thanks
>
> I changed my mind: Rather than checking the time when the
> task ran last time round, I'm now using a semaphore file. This
> approach requires much less code.
>
> Copy & past the code below into a batch file of your choice,
> fix up the wrapped lines, remove the line numbers and set
> the correct path for your application in Line 07. Now use
> the Task Scheduler to run this batch file once every 30 minutes.
> You will find that SysRestorePoint.exe will run just once
> every day.
>
> 01. @echo off
> 02. set LogDir=c:\Logs
> 03. set LogFile=%LogDir%\Semaphore.txt
> 04. if not exist "%LogDir%" md "%LogDir%"
> 05. robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" || goto
> :eof
> 06. echo Application last run on %Date% at %Time% > "%LogFile%"
> 07. "c:\Program Files\Your App\SysRestorePoint.exe"
>
> You can download robocopy.exe from the Windows
> Resource Kit.
>
My Line #5 ended like so:
|| goto :eof but you turned it into this:
|| goto
Something missing there . . .
You need the Command Line version of robocopy.exe.
Put it into c:\Windows.
"Mark" <secureourborders@hotmail.com> wrote in message
news:O5Fhs6DtIHA.4848@TK2MSFTNGP05.phx.gbl...
> Should it look like this? I downloaded robycopy gui, not sure what to do
> with. I saved as .bat. I don't think I did it right because when I clicked
> on the file the program didn't run. This may be over my head.
>
> Thanks
>
> @echo off
> set LogDir=c:\Logs
> set LogFile=%LogDir%\Semaphore.txt
> if not exist "%LogDir%" md "%LogDir%"
> robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" || goto
>
> echo Application last run on %Date% at %Time% > "%LogFile%"
> "C:\Documents and Settings\Mark\Desktop\SysRestorePoint.exe"
>
> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
> news:%23wejGjDtIHA.2208@TK2MSFTNGP04.phx.gbl...
>>
>> "Mark" <secureourborders@hotmail.com> wrote in message
>> news:%23YyW%235CtIHA.3680@TK2MSFTNGP05.phx.gbl...
>>> Can you explain how to set up and run this batch file? The program I
>>> want to run is "SysRestorePoint.exe". Every 30 minutes is probably
>>> sufficient.
>>>
>>> Thanks
>>
>> I changed my mind: Rather than checking the time when the
>> task ran last time round, I'm now using a semaphore file. This
>> approach requires much less code.
>>
>> Copy & past the code below into a batch file of your choice,
>> fix up the wrapped lines, remove the line numbers and set
>> the correct path for your application in Line 07. Now use
>> the Task Scheduler to run this batch file once every 30 minutes.
>> You will find that SysRestorePoint.exe will run just once
>> every day.
>>
>> 01. @echo off
>> 02. set LogDir=c:\Logs
>> 03. set LogFile=%LogDir%\Semaphore.txt
>> 04. if not exist "%LogDir%" md "%LogDir%"
>> 05. robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" || goto
>> :eof
>> 06. echo Application last run on %Date% at %Time% > "%LogFile%"
>> 07. "c:\Program Files\Your App\SysRestorePoint.exe"
>>
>> You can download robocopy.exe from the Windows
>> Resource Kit.
>>
>
>
That got messed up when I was going down the line deleting the numbers, but
that's fixed now. My program didn't run, but could that be because I
already ran the program manually? Also I downloaded the Windows Resource
Kit, but not sure what to do with it.
Thanks
Mark
"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:%239dlLAEtIHA.2292@TK2MSFTNGP03.phx.gbl...
> My Line #5 ended like so:
> || goto :eof but you turned it into this:
> || goto
> Something missing there . . .
>
> You need the Command Line version of robocopy.exe.
> Put it into c:\Windows.
>
>
> "Mark" <secureourborders@hotmail.com> wrote in message
> news:O5Fhs6DtIHA.4848@TK2MSFTNGP05.phx.gbl...
>> Should it look like this? I downloaded robycopy gui, not sure what to do
>> with. I saved as .bat. I don't think I did it right because when I
>> clicked on the file the program didn't run. This may be over my head.
>>
>> Thanks
>>
>> @echo off
>> set LogDir=c:\Logs
>> set LogFile=%LogDir%\Semaphore.txt
>> if not exist "%LogDir%" md "%LogDir%"
>> robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" || goto
>>
>> echo Application last run on %Date% at %Time% > "%LogFile%"
>> "C:\Documents and Settings\Mark\Desktop\SysRestorePoint.exe"
>>
>> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
>> news:%23wejGjDtIHA.2208@TK2MSFTNGP04.phx.gbl...
>>>
>>> "Mark" <secureourborders@hotmail.com> wrote in message
>>> news:%23YyW%235CtIHA.3680@TK2MSFTNGP05.phx.gbl...
>>>> Can you explain how to set up and run this batch file? The program I
>>>> want to run is "SysRestorePoint.exe". Every 30 minutes is probably
>>>> sufficient.
>>>>
>>>> Thanks
>>>
>>> I changed my mind: Rather than checking the time when the
>>> task ran last time round, I'm now using a semaphore file. This
>>> approach requires much less code.
>>>
>>> Copy & past the code below into a batch file of your choice,
>>> fix up the wrapped lines, remove the line numbers and set
>>> the correct path for your application in Line 07. Now use
>>> the Task Scheduler to run this batch file once every 30 minutes.
>>> You will find that SysRestorePoint.exe will run just once
>>> every day.
>>>
>>> 01. @echo off
>>> 02. set LogDir=c:\Logs
>>> 03. set LogFile=%LogDir%\Semaphore.txt
>>> 04. if not exist "%LogDir%" md "%LogDir%"
>>> 05. robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" ||
>>> goto :eof
>>> 06. echo Application last run on %Date% at %Time% > "%LogFile%"
>>> 07. "c:\Program Files\Your App\SysRestorePoint.exe"
>>>
>>> You can download robocopy.exe from the Windows
>>> Resource Kit.
>>>
>>
>>
>
>
You install the kit, then you it's probably best to copy
robocopy.exe from c:\program files\windows resource kit\...
to c:\windows.
You must, of course, make sure that ALL components
are in place. If you run the batch file without having robocopy.exe
in place then it will fail.
To test the program, don't run it from the Start / Run box.
If you do then you deprive yourself of all messages that
the program might give you! Open a Command Prompt
by clicking Start / Run / cmd {OK}, then run the batch
file from this black screen.
"Mark" <secureourborders@hotmail.com> wrote in message
news:OW1hMZEtIHA.524@TK2MSFTNGP05.phx.gbl...
> That got messed up when I was going down the line deleting the numbers,
> but that's fixed now. My program didn't run, but could that be because I
> already ran the program manually? Also I downloaded the Windows Resource
> Kit, but not sure what to do with it.
>
> Thanks
> Mark
>
> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
> news:%239dlLAEtIHA.2292@TK2MSFTNGP03.phx.gbl...
>> My Line #5 ended like so:
>> || goto :eof but you turned it into this:
>> || goto
>> Something missing there . . .
>>
>> You need the Command Line version of robocopy.exe.
>> Put it into c:\Windows.
>>
>>
>> "Mark" <secureourborders@hotmail.com> wrote in message
>> news:O5Fhs6DtIHA.4848@TK2MSFTNGP05.phx.gbl...
>>> Should it look like this? I downloaded robycopy gui, not sure what to do
>>> with. I saved as .bat. I don't think I did it right because when I
>>> clicked on the file the program didn't run. This may be over my head.
>>>
>>> Thanks
>>>
>>> @echo off
>>> set LogDir=c:\Logs
>>> set LogFile=%LogDir%\Semaphore.txt
>>> if not exist "%LogDir%" md "%LogDir%"
>>> robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" || goto
>>>
>>> echo Application last run on %Date% at %Time% > "%LogFile%"
>>> "C:\Documents and Settings\Mark\Desktop\SysRestorePoint.exe"
>>>
>>> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
>>> news:%23wejGjDtIHA.2208@TK2MSFTNGP04.phx.gbl...
>>>>
>>>> "Mark" <secureourborders@hotmail.com> wrote in message
>>>> news:%23YyW%235CtIHA.3680@TK2MSFTNGP05.phx.gbl...
>>>>> Can you explain how to set up and run this batch file? The program I
>>>>> want to run is "SysRestorePoint.exe". Every 30 minutes is probably
>>>>> sufficient.
>>>>>
>>>>> Thanks
>>>>
>>>> I changed my mind: Rather than checking the time when the
>>>> task ran last time round, I'm now using a semaphore file. This
>>>> approach requires much less code.
>>>>
>>>> Copy & past the code below into a batch file of your choice,
>>>> fix up the wrapped lines, remove the line numbers and set
>>>> the correct path for your application in Line 07. Now use
>>>> the Task Scheduler to run this batch file once every 30 minutes.
>>>> You will find that SysRestorePoint.exe will run just once
>>>> every day.
>>>>
>>>> 01. @echo off
>>>> 02. set LogDir=c:\Logs
>>>> 03. set LogFile=%LogDir%\Semaphore.txt
>>>> 04. if not exist "%LogDir%" md "%LogDir%"
>>>> 05. robocopy /L /MinAge:1 "%LogDir%" c:\ *.* | find /i "new file" ||
>>>> goto :eof
>>>> 06. echo Application last run on %Date% at %Time% > "%LogFile%"
>>>> 07. "c:\Program Files\Your App\SysRestorePoint.exe"
>>>>
>>>> You can download robocopy.exe from the Windows
>>>> Resource Kit.
>>>>
>>>
>>>
>>
>>
>
>