To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example uses the System Exec VI or Call Library Function Node to either sleep, shutdown, restart or lock a windows PC.
Description
This simple event driven VI uses the System Exec VI or Call Library Function Node to either sleep, shutdown, restart or lock a windows PC.
Call the "LockWorkstation" method within the "user32.dll" using a "Call Library Function Node"
Call the "SetSuspendState" method within the "powrprof.dll" using a "Call Library Function Node". Needs parameters 0,1,0.
Requirements
Steps to Implement or Execute Code
Additional Information or References
Front Panel
VI Snippets
Tested on windows 7. Written in LabVIEW 2011 with silver buttons then saved for previous in LabVIEW 8.6
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
The version that claims to be 8.6 is actually 2011 (11.0). Could you please revert it. Thank you.
sorry dragon, v8.6 is there now. Thank you for letting me know.
Hi Lewis. How about 8.0 too
Done
Must we have administrator privileges on the computer to do that ?
Would this work on windows 8?
Also, I'm trying to get a LV exe to run during Connected Standby. Is it possible at all?