restart after batch is complete?

Discuss new features and functions
Posts: 2
Joined: 22 Nov 2016

zarko

Hi,

How can I setup a batch job, so that when it's complete, it will restart the PC.
From what I can see is that "ON COMPLETION:" dropdown list (in the SAVE AS BATCH JOB dialog), there is LOG OFF, STANDBY and SHUTDOWN, but NO RESTART.

So how can I tell the batch to restart the PC?

Thanks
User avatar
Posts: 17
Joined: 20 Oct 2016

Zargron

Well, you could run FFS from a script. When you save your batch job, perhaps set:

Handle Errors=Stop
On Completion=Close progress dialogue

If you are using windows, create a BAT file that contains something like this:
@echo off
REM Run FFS batch job as specified by first parameter

"%programfiles%\FreeFileSync\FreeFileSync.exe" %1
if %ERRORLEVEL% EQU 0 goto RESTART
echo Error running FFS
goto END

:RESTART
echo Restart
shutdown -r -t 15

:END
Create a shortcut to that BAT file passing the path & filename of your "ffs_batch" job file as the first parameter. Then you can restart your computer after running whatever FFS batch job you like by creating different shortcuts for your different batch jobs.
User avatar
Site Admin
Posts: 7058
Joined: 9 Dec 2007

Zenju

Or just enter "shutdown /r /t 60" in the "on completion" box. No need to pick any of the predefined values.
Posts: 2
Joined: 22 Nov 2016

zarko

Thank you! Simple and elegant solution