Question Locked

VBS and Perl

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi All

We have a set of .bat files (4 in all) which each delete a file and then call a perl process/script (each 1 of the 4 is different). These processes open in a cmd window. Therefore each time we have to restart these processes, we need to ctrl - c the processes in the 4 cmd windows in order to kill them and then open each of the 4 bat files again to start the perl processes again. I am trying to condense this all down to a 1 file operation by using .vbs. I have some code which will delete the files as required and also it calls the pearl processes however I need help in writing the code which can kill the processes running in the cmd windows (i.e something which performs the ctrl c funtion).

I hope the above makes sense, I am a willing amateur where scripts are concerned.

Thanks in advance
Nick

2 replies

by scott_heath

you can use wmi in vbscript to find specific processes and kill them. You should probably create the process using wmi as well as it will specify the pid, which you can then use to kill the process. Otherwise if the processes call the same file, ie dowork.exe, then it will be hard to them apart. If you need sample code I can provide some.

This discussion is closed to new replies.