06-23-2017 04:28 AM
I tried to run the command as you said, but it returns this error mesage
Maybe I made a mistake writting the command you said, what do you think?
06-23-2017 04:47 AM - edited 06-23-2017 04:51 AM
Yes, there is a mistake.
Why did you write the bolded stuff: taskkill /FI Símbolo del sistema eq cmd/c bla bla bla ?
You should write exactly as I have showed in the prior post. with "*" and make sure after taskkill there is a space in between taskkill and /F
I think you should write exactly the following: taskkill /FI "windowtitle eq Símbolo*" /F
06-23-2017 09:09 AM
I wrote it like that because I have undertood the message like this: taskkill\FI "(title of the window I want to close) eq (my command)" \F.
So then I have to write the code as taskkill /FI "windowtittle eq (tittle of the window I want to kill)*" /F.
I tried it writting what you said but the error remains.
06-23-2017 09:16 AM
https://technet.microsoft.com/en-us/library/bb491009.aspx
06-29-2017 02:42 PM
Try with this: taskkill /im cmd.exe
Probably there is an issue with accents as you have your computer in spanish.
06-30-2017 04:01 AM
Okay, so you are saying to refer to the command window as an image, interesting I will try it.
06-30-2017 09:18 AM
@kibkib wrote:
Okay, so you are saying to refer to the command window as an image, interesting I will try it.
Taskkill: Ends one or more tasks or processes. Processes can be killed by process ID or image name.
That is why I set the command window title in my example
Anyway the part I want you to see is I set the window title of the Iperf window with the "title Client" line in the batch file. This is important as you will see below.
To kill the running Iperf I use the taskkill command, notice that taskkill need the window title of the task you are killing.
That says taskkill /FI "windowtitle eq Client*"
The only caveat I have ran into is taskkill can not kill a task that is ran as Administrator, seemingly even if my executable is ran as Administrator. I am guessing even if the LabVIEW executable is ran as Administrator, the systemexec is still running at lower privileges? So if someone has messed with Windows UAC (like I found on several machines on our lab) and set console windows to always run as Administrator, taskkill will fail.
07-03-2017 03:53 AM
taskkill /im cmd.exe is working, but it closes the cmd window instantaneously. And as I explained before I need to close the window moreless in 10 seconds. It is posible to do what I want using timers or something like that?
07-03-2017 04:05 AM
Delay your calling of the SysExec that runs taskkill.
The simplest way to do this would be to use a Wait (ms) node with a constant and a Flat Sequence structure passing through an error wire or similar.
In 2017, there's a VIM called (I think) Delay Data Flow that does the same thing.
If you need other things to happen during that 10s, you can consider better structuring your code to allow a delay then the kill command. A State Machine might help you there, as could a Producer/Consumer design.
07-03-2017 05:46 AM
I used the VIM you mentioned and it works, im able to delay the clossing the time I want.
The name of the VIM is stall data flow
thanks for your help! My programm now runs automatically from the start to the end!