Example Code

Cancel Shutdown

Code and Documents

Attachment

Overview

This VI aborts shutdown once a second.  It is similar to typing "shutdown -a" in the command prompt.

Description

You might want to use this if you are on a domain and admins, users, or system processes shut down the computer.  You can run this and it will call the CancelShutdown() function in user32.dll once a second.

Steps to Implement or Execute Code

  1. Download and run in 2011
  2. Try to shut down your computer
  3. Smile because the shutdown procedure will be aborted once a second.

Requirements

Software

LabVIEW 2011 or later

Windows operating system.  This may not be compatible with every version of Windows.

Hardware

your computer

VI Snippet

abort shutdown.png

Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors