ThinkVantage key to lock your screen under Windows 7
At home, I use Debian on my ThinkPad, and have remapped the ThinkVantage key on top of the keyboard to lock my screen. It’s just a single press of a button, and it makes you feel a little safer if you have your laptop standing in a semi-public space.
At work, I also have a ThinkPad, but with Windows 7 on it. Now, I wanted the same functionality on there as well. I tried doing so using AutoHotkey, but that would not recognize the key press. So some digging got me to the following solution:
- Create a small batchfile, let’s say under “C:\lock.bat”, with the following contents:
12@echo offrundll32 user32.dll, LockWorkStation
- In you registry, create (I had to do so, along with the directory) or change the following key:
Make sure, the path matches the path to the file you created. Every backslash is converted into two backslashes.
And there you have it. For me, it worked right away. No reboot, no logging in again, it just worked immediately.