tags:

views:

594

answers:

1

I'm writing a script for Caseware, the accounting software my Company uses, and I need to kill a process that hangs and messes up the compression of files on the server. The problem is it needs to be written in jscript and I havn't had a lot of experience with it.

I've been looking around for code examples people use to kill process but I couldn't find much. I did find an example of someone calling an .exe from jscript and I thought I'd try it using the taskkill.exe in windows, but it didn't seem to work.

Here's the block of code that I used.

    function OnFileClose()
{
   w = new ActiveXObject("WScript.Shell");
   w.run("taskkill.exe /im iexpore.exe");
   return true;
}

I'd appreciate any examples people have or suggestions.

Thanks.

Update: I've done some more testing on the script and I've figured out that it actually executes taskkill.exe, but it isn't passing the /im parameter.

+2  A: 

Shouldn't that be iexpLore.exe rather than iexpore?

Luke Bennett
wow, I'm embarassed. I make I typo in the process I was using to test it. Works fine.
Dave
Been there, done that!
Luke Bennett