LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How close an executable

Thanks, the start mspaint command (for me) works but not the kill task (always error message) ? And when I highlight the execution, the execution doesn't go to the sequence structure, it blocks at the system exec except when I manually close the paint application.  
0 Kudos
Message 11 of 23
(1,131 Views)
I'm not sure why it doesn't work...
Which error messages/codes do you get?
After the .bat file has functioned, I would suggest that you lay the TASKKILL likewise in an .bat file and call it with the same principle of the before posted example.
If you have closed the process by hand,  you will get only error code 128 "Process "xxx" was not found.

Furthermore, you can create the .bat file dynamically with the "write to text file" function.

Regards,
ThSa
0 Kudos
Message 12 of 23
(1,115 Views)

Hi,

 

The error message I get is error 2: possible reason memory is full. I did the same thing with taskkill than with start ms paint but it dosen't work (see the attached code in oreder to see if I did right).

It is maybe worthnoting to say that the command taskkill doesn't work in the start-run.  

0 Kudos
Message 13 of 23
(1,104 Views)

Hi,

 

The error message I get is error 2: possible reason memory is full. I did the same thing with taskkill than with start ms paint but it dosen't work (see the attached code in oreder to see if I did right).

It is maybe worthnoting to say that the command taskkill doesn't work in the start-run. 

0 Kudos
Message 14 of 23
(1,096 Views)
I think, further steps are Windows support and not LabVIEW support...
Navigate to C:\Windows\system32 and look for taskkill.exe

Regards,
ThSa

0 Kudos
Message 15 of 23
(1,096 Views)
Yes, taskkill exists in windows 32.
0 Kudos
Message 16 of 23
(1,091 Views)
I tried this on my system and found that it worked with some applications and it did not work with others.  In the applications that did not work, if you close the application manually, the vi will then start the delay timer and finish its execution, you can see the command window pop up for the kill.
 
Here are some applications that this vi works with:
winword.exe
excel.exe
visio.exe
wordpad.exe
 
Here are some applications that do not work:
mspaint.exe
notepad.exe
calc.exe
 
My guess is this:  It seems like the vi waits for some acknowledgement from the application that the open was successful.  Those that did not work never sent acknowledgement, and the vi gets hung up on the first System Exec call.  When the app is closed manually, the Sys Exec gets something and the vi continues.
- tbob

Inventor of the WORM Global
0 Kudos
Message 17 of 23
(1,076 Views)