Example Code

Windows Shutdown from LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This VI uses the System Exec.VI to run a command line in DOS that will shut down Windows based on the string input into the command line.

 

Description

This code consists on using the System Executive VI to run a command line in the command prompt. In the block diagram is a list with the possible commands to run. It is important to notice that running a shutdown command will shut the computer you are in, so it is recommended not to use the shutdown command.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Verify you will run the desired command.
2. Run the VI.

 

Additional Information or References

 Snippet.png

National Instruments
Applications Engineer

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

Comments
Todd S.
NI Employee (retired)
on

Good call including the "warning" image. People need to understand that.

Todd S.
LabVIEW Community Manager
National Instruments
Andrey_Dmitriev
Trusted Enthusiast
Trusted Enthusiast
on

As far as I know, this easiest way will work from Administrator account only.