Shutdown not working with scheduler - NOT SOLVED

Have questions about Backup4all, or having problems using it? Ask here for help.
Post Reply
drc
Posts: 19
Joined: Wed Oct 04, 2017 6:33 pm

Shutdown not working with scheduler - NOT SOLVED

Post by drc »

I have two identical back-up jobs. One is scheduled (due to start at 23:59:00) the other is manual.

When i run the manual job the computer is shutdown upon success - as per the job properties. This is despite me logging out (using the windows key+L) and leaving the PC to it.

When the same job is initiated via the scheduler the shutdown action specified under 'Advanced - Run action after backup' appears not to be initiated unless I am logged onto the windows account at the time of completion. This is despite the windows account password having been specified in the Scheduler - general - scheduler - Run whether the user is logged on or not'. I know that the password is correct as if logged out of the windows account (via the windows key+L) the backup job initiates successfully and completes successfully. It just doesn't run the shutdown command.

BTW: I am shutting down by calling a shutdown.bet file (discussed in another post on this forum) because the inbuilt <shutdown> command in the 'Advanced- Run action after backup' simply doesn't work in any circumstances.

I am running B4A 7.5 build 543. Windows 10.

Any thoughts?
Last edited by drc on Mon Apr 20, 2020 6:16 pm, edited 2 times in total.

Adrian (Softland)
Posts: 1548
Joined: Wed Dec 16, 2009 12:46 pm
Location: Cluj-Napoca, Romania
Contact:

Re: Shutdown not working with scheduler

Post by Adrian (Softland) »

Hi,

Is the scheduled task configured to run with highest privileges? (in Control Panel->Administrative Tools->Task Scheduler)

What about if you set in Backup4all to run: shutdown.exe /s /f

drc
Posts: 19
Joined: Wed Oct 04, 2017 6:33 pm

Re: Shutdown not working with scheduler - SOLVED

Post by drc »

I thought I'd provide an update in case it helps others trying to do the same thing.

I did ensure that the 'scheduled task (was) configured to run with highest privileges' as per Adrian's suggestion. I still couldn't get the laptop to shutdown after a successful back-up either using the in-built <shutdown> command or my shutdown.bat file. However, i have found that if i leave B4A open (i.e. running) before locking (using the windows key+L) the screen, the in-built shutdown command does shut the PC down upon success. Woooo Hoooo.

To be clear, if the B4A application is not running the scheduled backup still happens but doesn't initiate the shutdown upon success. The B4A application must be open (aka running) for the shutdown upon success to be initiated.

So I now have a different back-up task for each day of the week scheduled to run at 11:59pm (I rotate between a local FTP drive, OneDrive and GoogleDrive with a single day using another online drive) and these shutdown the PC upon success! Happy days!

drc
Posts: 19
Joined: Wed Oct 04, 2017 6:33 pm

Re: Shutdown not working with scheduler - NOT SOLVED

Post by drc »

I spoke too soon.

Having had a solid week of the system shutting down as expected, I've just had a solid week of it not shutting down! Nothing has changed - except a Windows update.

I've just rechecked in Task Scheduler and found that 'run with highest privileges' was unchecked and that the 'configure for' option was specifying Windows Vista and Windows Server 2008'. So I've reset it all to Windows 10 and to run with the highest privileges and wait for another night.

Post Reply