1
So here's the story; At work I have two computers. Both Windows 7 and on the same network.
I've used the shortcut trick to create shortcuts on both computers that lock them when I leave.
rundll32.exe User32.dll,LockWorkStation
I was wondering though if there was a way to modify the shortcut or create a .bat file on my "main" workstation that would allow me to lock both stations.
I've googled a few times for a solution, but most results just lead back to instructions on creating the 'standard' shortcut I mentioned above, or a similar question asked on Stackoverflow, where installing 3rd party software is suggested.
Are these computer linked together in some capacity ( i.e. connected tot he same domain )? – Ramhound – 2016-01-20T19:51:42.343
If both workstations are part of domain and your user has all required permission than it appears that this can be achieved using little VB script. This old post on MSFT Scripting guy has instructions for just about that. http://blogs.technet.com/b/heyscriptingguy/archive/2004/11/15/can-i-lock-a-workstation-using-a-script.aspx (Word of caution: I have not tried it personally)
– JackLock – 2016-01-20T20:32:34.650Ramhound, Yes, both computers are part of the same network and domain. – Dex Luther – 2016-01-21T22:59:23.003
Danger!
rundll32
is not an officially supported way to invoke Windows API functions. For this application, usetsdiscon
. – Ben N – 2016-01-22T00:25:51.133