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,273 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,257 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,246 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,238 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,238 Views)
Yes, taskkill exists in windows 32.
0 Kudos
Message 16 of 23
(1,233 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,218 Views)

Hi,

 

Yes I confirm what you said but it seems that in creating a constant on wait until completion in the system exec.vi the information passes. But I have always the problem of error 2 that occured in the second system exec Vi: memory is full. It is a strange problem because, of course, it is not true.

 

It is fundamental for me, the application automatically closes or minimizes and reappears automatically. If not I lost the control of the experiment.    

0 Kudos
Message 18 of 23
(1,208 Views)
Hi, I succeed to send a taskkill application to the run start  mode of my  PC, but it doesn't work with labview, it opens the application, runs until 5 seconds and after, when it must close the application error message: memory is full occured, with blinking to the second system exec. vi.

I use windows XP professionnal.
0 Kudos
Message 19 of 23
(1,200 Views)
Problem resolved. I reconfigure  taskkill with bat file and it works.
Thanks a lot for your help.
0 Kudos
Message 20 of 23
(1,194 Views)