tags:

views:

29

answers:

1

This is a part of my project, my project basically uses a motion sensor to detect any intrusion. So one of the modules is to lock the PC on detection of an intruder. Is there a way to lock the PC using visual basic?(because most of the other modules have been programmed in vb)..basically looking for a source code that can implement something similar to "windows button + L", cheers thanks:)

+3  A: 

A simple way would be:

Set shell = WScript.CreateObject("WScript.Shell")
shell.Run "rundll32 user32.dll,LockWorkStation"
Nick Presta
well the above code din't work so just used,Shell("rundll32.exe user32.dll,LockWorkStation") and it worked..thanks:)
Tarun