Question: I need to change my FTP password, from an Ubuntu server with the command line, can you help me?

Thank you all!

Answer: 
**Two steps:** 

* Capture the close lid event.
* Trigger a lock-screen event.

See: [Capturing laptop lid closing event in windows?](https://stackoverflow.com/a/37179068/6278788), and [Command-line (cmd) command to lock a windows machine](https://superuser.com/a/21180/364367).

From those sources, we can use `RegisterPowerSettingNotification` and `GUID_LIDSWITCH_STATE_CHANGE` to detect the trigger, and run:

```
rundll32.exe user32.dll,LockWorkStation 

```

from the command line to send a lock screen request to the machine.

I don't know what compilers you have available, or what languages you know, but this information should help you set up a program to do it for you.

I don't use Windows myself, so I can't build or test it for you.
The solution is simple, in options --> accounts --> Sign-in options: Require sign-in = Every Time

[![enter image description here](https://i.stack.imgur.com/Wey3J.png)](https://i.stack.imgur.com/Wey3J.png)