Take a New Notepad file >> save this command as batch file

rundll32.exe user32.dll, LockWorkStation

Control panel>> Scheduled Tasks>>

Add task >> point to bat file saved in above step >> schedule it as per your convenience .

You are done!!