Lock screen after specific app quit : How to?

Page 1 of 4 123 ... LastLast

  1. Posts : 91
    Ultimate x86 & x64
       #1

    Lock screen after specific app quit : How to?


    Hello,

    I need lock screen to launch right after a specific app quit. I looked in task scheduler but lack knowledge. Can i do it within or i need another app?

    Thanks.
      My Computer


  2. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #2

    This is how to do it with a batch file:
    • Locate the EXE file or shortcut of the application. I am using MsOffice Excel in this example, in my system the program EXE file is called EXCEL.EXE and it is located in C:\Program Files\Microsoft Office\Office15\ folder
    • Open Notepad
    • Type these two lines to a new text document, replacing the program or shortcut path with your program or shortcut. If using shortcut, the extension is .lnk:
      Code:
      "C:\Program Files\Microsoft Office\Office15\Excel.exe"   
      rundll32.exe user32.dll, LockWorkStation
    • Save the file to desktop selecting Save as type as All Files, remember to end your chosen filename with extension .bat:
      .
      Lock screen after specific app quit : How to?-lock_bat.png
      (Click to enlarge.)

    That's it. To run the program, Excel in this example, user now double clicks the icon of this batch file on desktop. This opens the program. As soon as user exits the program, Excel in this example, computer is locked.

    Kari
      My Computer


  3. Posts : 91
    Ultimate x86 & x64
    Thread Starter
       #3

    Thank you!
      My Computer


  4. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #4

    You are welcome!
      My Computer


  5. Posts : 91
    Ultimate x86 & x64
    Thread Starter
       #5

    Unfortunatly that won't do for me : i wanted to use for a screensaver that can't be used normally (incompatibility on x64 systems..) but it i input the screensaver location it will launch.. its settings! And if i make a shortcut of it, it'll directly go to lock screen (tried with jpg file instead, same, doesn't launch, direct lock screen)
      My Computer


  6. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #6

    goja said:
    Unfortunatly that won't do for me
    The batch file I told you how to create works without issues. It launches a program and after the program is finished goes to lock screen. The batch works perfectly.

    If you have problems to get your programs to work, it has nothing to do with this batch file. Start a new thread and ask help. Notice that there's no way to get a program to work on x64 system if the maker tells it's not x64 compatible.

    Kari
      My Computer


  7. Posts : 91
    Ultimate x86 & x64
    Thread Starter
       #7

    Sorry but no. The app itself launch, but it I use the bay it directly went to lock screen.. I will try again but well..
      My Computer


  8. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #8

    goja said:
    Sorry but no.
    Sorry but yes.

    If it went direct to lock screen using the batch file, it means that the app shuts itself down. The batch works, it only goes to lock screen when the app is closed (shut down).

    Kari
      My Computer


  9. Posts : 91
    Ultimate x86 & x64
    Thread Starter
       #9

    Try it with any screensaver (making a shortcut if it) and tell me what happens.
      My Computer


  10. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #10

    goja said:
    Try it with any screensaver (making a shortcut if it) and tell me what happens.
    Of course it does not work with screensavers! It works with programs and applications. A screensaver (.scr file) is not a normal application per se; the lock screen command in batch file is as "exit" command for a screensaver so it shuts down and proceeds to lock screen.

    If you want to automatically go to lock screen after screensaver has closed (mouse movement or keyboard press), you need to set the highlighted option on screensaver settings:

    Lock screen after specific app quit : How to?-screen-saver-settings.png

    Kari
      My Computer


 
Page 1 of 4 123 ... LastLast

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

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