Example Code

Kill Windows Tasks 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 example shows how to use the LabVIEW System Exec.vi function to kill a task in Windows OS

 

Description

Using the LabVIEW System Exec.vi function you can make a taskkill call to the Windows OS. The attached VI takes the task name as a string and will kill the named task through the Windows console. Task names are as they appear in the task manager

In the attached VI the first part of the command is provided.  You simply needs to input the process name and the VI appends the strings to make the full command.

 

Requirements

LabVIEW Base Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Enter the task name to be ended, make sure to include the .exe suffix if needed
  2. Run the VI

 

Additional Information or References

VI Block Diagram

4815.PNG 

**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.

Comments
Member
Member
on

How do we use keyboard shotcuts like Ctrl+C and insert it to terminate a process?

RY