LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

taskkill from sys exec VI

I am having a problem. I have a LabVIEW application that does many automated test and programming tasks on a product. On of the programming tasks is to copy an image file into a SOM that has an imx6 processor. To accomplish this, the processor is placed into a mode where it appears as a USB drive on Windows, This all works and LabVIEW can then call a c CLI using the sys exec VI to send the image file to the apparent USB drive. However, when the apparent USB drive open, Windows display the usual messages about what shall it do with the drive, etc.. All of these massaged appear under the explorer.exe task. I want to close them all from LabVIEW. SO:

 

1. I can wait until the system is programmed, then open a command prompt (not the sys exec) 

2. I can type into the command prompt, taskkill /F /IM exporer.exe && explorer.exe

 

This works. Note than if I do not use the /F then the messages do not close. With the /F all the little windows messages close up and my PC continues to work normally.

 

If I send the same command using the LabVIEW sys exec, the Windows messages close, but I am left with a black screen with only LabVIEW visible and working. Nothing else is on the screen. I must then reboot my PC to get things back to normal. 

 

I have seen ides based on bring the explorer.exe window to the front and then attempting to press the Cancel button programmatically, but it does not work, and I am not sure how to pick which button to push as I cannot set the focus on the Windows message.

 

Any ideas? 

 

Thanks,

Sid Levingston

0 Kudos
Message 1 of 5
(1,409 Views)

Set "Auto Play" to "Do Nothing" when a USB drive is inserted.

 

https://www.windowscentral.com/how-configure-autoplay-windows-10 

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(1,363 Views)

Thank you. This works. I will now see if there is a wat to do this form my LabVIEW program. I am thinking I can use the registry edit VIS to accomplish the same thing, then I can put things back when the program is finished.

0 Kudos
Message 3 of 5
(1,333 Views)

Just attach a simple VLC.vi in case someone needs it.

yuntan_0-1700606967061.png

 

 

0 Kudos
Message 4 of 5
(639 Views)

Hi yuntan,

 


@yuntan wrote:

Just attach a simple VLC.vi in case someone needs it.


You know you forgot to attach that VI? All we got is an image…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(621 Views)