Click to See Complete Forum and Search --> : calling .BAT files..


kbrown2974
01-14-2004, 07:38 AM
I am looking to run a DOS .BAT file from a web app. Is this possible? If it is, what kind of syntax would I use to have it run?

Khalid Ali
01-14-2004, 07:51 AM
No, not with JavaScript only.
You will need to some type of ActiveXControl for MS or a java applet

Fang
01-14-2004, 08:14 AM
WARNING USE WITH CAUTION!

var obj_ws = new ActiveXObject("WScript.Shell");
if(confirm("Open trash.bat?")) {
obj_ws.Run("c:\\trash.bat")
}

Only works with IE

Khalid Ali
01-14-2004, 08:30 AM
I personally would not guide new members to a solution like this which can be immensely consequential.

Fang
01-14-2004, 08:47 AM
The solution can only work if the file/application exists.
I did not show how to read or write to an application, which is also possible.

kbrown2974
01-14-2004, 09:10 AM
The thing is that I am trying to use an OCX to do some digital recording of phone calls. I dont know how to implement that at all!