LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How close an executable

Hi,
 
I have some experiments to conduct, and I would like to program opening and closening of external applications like paint or word.
This means that I would like, for example, opening paint for 20 seconds and then close paint and return to the program.
Is it possible?
Thanks.
0 Kudos
Message 1 of 23
(3,998 Views)

Hi,

you can use the systemexec.vi to start / shutdown processes.
The syntax to kill a process is the following: TASKKILL /F /IM mspaint.exe /IM notepad.exe

Regards,
ThSa

0 Kudos
Message 2 of 23
(3,985 Views)

Thanks. I have tried your command but it doesn't work like I want. It doesn' close paint application.

Here the vi I wrote. 

0 Kudos
Message 3 of 23
(3,975 Views)
Hi,
sorry but I havn't intalled mspaint, therefore I tested it with winword.
The screenshot shows the right syntax...



Regards,
ThSa

Message Edited by ThSa on 04-24-2006 07:42 AM

0 Kudos
Message 4 of 23
(3,959 Views)

Hi,

 

I used your code but it didn't work as a closing of application:

1) In fact a little dark screen is blinking, with c\windows32\system\command.com noted. The process didn't close paint application

2) Is your code inlude opening of paint (or word) ? For this Do I have to use another system.exe vi with path to paint?

3) I use a windows xp pro computer. In the the context help, it says me that I have to use command.com, so I used it. Unless using it error message appeared "memory is full".

They say also that:

"To launch an executable with options using the syntax filename.exe -option1 -option2, create a filename.bat file that calls the executable with the options syntax and use this VI to call the filename.bat file. "

But I don't know How do and if it is needing as you succeed unless it. 

   

0 Kudos
Message 5 of 23
(3,938 Views)
The attached picture shows the code for the entire process (open - wait - close)



Regards,
ThSa

Message Edited by ThSa on 04-24-2006 11:27 AM

0 Kudos
Message 6 of 23
(3,936 Views)
Thanks, but again it doesn't work in my computer with word and paint. Strange!!
0 Kudos
Message 7 of 23
(3,923 Views)
What happens if you navigate to Start -> Run -> "winword.exe" -> OK?
If this fails, the path variable isn't set.

Path Variable

Regards,
ThSa
0 Kudos
Message 8 of 23
(3,920 Views)
 when I do Start -> Run -> "winword.exe" -> it's OK, it opens word application. Same thing with paint  
0 Kudos
Message 9 of 23
(3,915 Views)
Hmmm, very curious.
You will find another example in attachement (LV 7.1 or later)

Regards,
ThSa
0 Kudos
Message 10 of 23
(3,910 Views)