I would use Autologon from Sysinternals to autologon, but add a scheduled task with a trigger (start at login) and enter this command in the task scheduler
Program: rundll32.exe and as parameters: user32.dll,LockWorkStation
and create the task. The rundll32 command locks the PC after the automatic logon. So you get your task running but the PC will be locked.