Page 1 of 1

function create_daily_task()

Published: January 25, 2017 - 2:26 PM
by gaelds
Good morning,

I have a message that I don't understand in the poweroff package on XP PCs.

TypeError: create_daily_task() takes at least 3 arguments (5 given)

Code: Select all

create_daily_task('test_shutdown_windows',r'C:\Windows\System32\shutdown_test_session.bat', max_runtime=120,start_hour=19,start_minute=00)
Should arguments be removed or added?

Re: create_daily_task() function

Published: January 25, 2017 - 2:34 PM
by htouvet
You need to pass at least 3 parameters: name, cmd, parameters
So the order would be

Code: Select all

create_daily_task('test_shutdown_windows',r'cmd',r'/C C:\Windows\System32\shutdown_test_session.bat', max_runtime=120,start_hour=19,start_minute=00)

Re: create_daily_task() function

Published: January 26, 2017 - 08:16
by gaelds
Ah ok thank you, since the message contained "(5 given)", I thought that "max_runtime" etc. were parameters.