Scheduled task doesn't work when Windows is locked


  1. Posts : 10
    Windows 10
       #1

    Scheduled task doesn't work when Windows is locked


    I have an odd request. I have my PC at work automated to backup everything on it every day at the same time, but I have it set to do so after I've closed all my programs and left. Reason is I also have it backing up my locally stored Outlook files, but the backup fails as long as Outlook is running. I leave at 5:00, the backup starts at 5:15, and then I also created a scheduled task to log Windows out at 5:30 ("c:\Windows\System32\shutdown.exe" in the Program/script box and "-l" in the Add arguments box). I like it logged out so when I come in the next morning, I have to open a number of programs, and I have scheduled tasks at logon to open all of these programs for me. My issue is I lock my PC at 5:00 right before I leave. I've noticed when I do this the log off task simply fails. It works fine when unlocked, but not when locked. I could just turn off auto lock but I like it to be locked when I'm not near it and I usually do lock it myself manually but sometimes I forget. This is strange since even though it's locked, it's technically still logged on. The only thing I tried is setting the task to "run whether user is logged in or not" but that makes the task stop working completely, when I try to run it, it just does nothing. Does anybody know if there's a workaround to make it work when the screen is locked?
      My Computer

  2. dalchina's Avatar
    Posts : 29,942
    Win 10 Pro (1903)
       #2

    Hi, quick thought- is the PC in sleep mode by the time the task should run.. and if so, have you configured the task to wake the PC?
      My Computers


  3. Posts : 10
    Windows 10
    Thread Starter
       #3

    dalchina said:
    Hi, quick thought- is the PC in sleep mode by the time the task should run.. and if so, have you configured the task to wake the PC?
    It isn't in sleep mode when this happens.
      My Computer

  4. dalchina's Avatar
    Posts : 29,942
    Win 10 Pro (1903)
       #4

    Thank you for your reply.

    shutdown -l
    as a scheduled task does not appear to work when the PC is locked.
    I found an old thread where people had attempted to use various forms of command to log off a PC using a scheduled task when locked without success.

    Out of curiosity, I tried a freeware program 'Dont Sleep'. One of its various functions is a countdown timer to various events, one of which is to log off.

    This worked when the PC is locked. However that's no more than a demonstration, as whilst the program has some command line parameters, they are rather limited- or perhaps the doumentation is.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:11.
Find Us




Windows 10 Forums