Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Lock screen after specific app quit : How to?

25 Jan 2013   #1

Ultimate x86 & x64
 
 
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 System SpecsSystem Spec
.

25 Jan 2013   #2

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro Preview with Media Center
 
 

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 System SpecsSystem Spec
25 Jan 2013   #3

Ultimate x86 & x64
 
 

Thank you!
My System SpecsSystem Spec
.


25 Jan 2013   #4

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro Preview with Media Center
 
 

You are welcome!
My System SpecsSystem Spec
26 Jan 2013   #5

Ultimate x86 & x64
 
 

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 System SpecsSystem Spec
27 Jan 2013   #6

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro Preview with Media Center
 
 

Quote   Quote: Originally Posted by goja View Post
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 System SpecsSystem Spec
27 Jan 2013   #7

Ultimate x86 & x64
 
 

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 System SpecsSystem Spec
27 Jan 2013   #8

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro Preview with Media Center
 
 

Quote   Quote: Originally Posted by goja View Post
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 System SpecsSystem Spec
27 Jan 2013   #9

Ultimate x86 & x64
 
 

Try it with any screensaver (making a shortcut if it) and tell me what happens.
My System SpecsSystem Spec
27 Jan 2013   #10

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro Preview with Media Center
 
 

Quote   Quote: Originally Posted by goja View Post
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:

Name:  Screen Saver Settings.png
Views: 2
Size:  14.2 KB

Kari


My System SpecsSystem Spec
Reply

 Lock screen after specific app quit : How to?





Thread Tools



Similar help and support threads for2: Lock screen after specific app quit : How to?
Thread Forum
Screen lock up. Performance & Maintenance
Add Shutdown to lock screen? General Discussion
Solved Application specific lock ups. Software
Looking for a specific screen recorder Music, Pictures & Video
Caps lock, num lock, scroll lock screen messages General Discussion
Enabling lock screen Software
Lock Screen General Discussion

Our Sites

Site Links

About Us

Find 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 09:24 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33