Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locking computer remotely

Tags:

windows

Is there any way that one can lock a desktop computer remotely? For example, if one accidently leaves a computer logged on, would there be a way to lock that computer using Remote Connection (VPN)?

like image 563
Mayou Avatar asked Nov 01 '13 21:11

Mayou


2 Answers

Use PsExec to invoke:

rundll32.exe user32.dll, LockWorkStation

on your remote PC.

If you are currently on PC_A and want to lock PC_B, type this on your command line (on PC_A):

psexec \\\PC_B -u user -p pass "rundll32.exe user32.dll, LockWorkStation"

This way rundll32.exe user32.dll, LockWorkStation will be invoked on PC_B.

like image 69
Artur Avatar answered Oct 31 '22 07:10

Artur


You can create a file with an arbitrary name and the suffix bat use this code in bat file

rundll32.exe user32.dll, LockWorkStation

save and run

like image 41
M.Ganji Avatar answered Oct 31 '22 07:10

M.Ganji