Hi,

I did this the other day with a bat file.

First I cause an open/save prompt with 

response.addHeader("Content-Disposition", "attachment; filename=somebat.bat");

Then I use the response.getOutputStream() and stream the bat file down it. This 
requires of course that you get an inputstream to your bat file first. Copy it 
into your webapp somewhere and use the servlet context 
getRealPath("/bat/mybat.bat") and then i/o API to read it into an input stream 
before sending outbound again. 

I found that setting content type of application/msdos-x-batch failed, as did 
others, just send it without a content type as a open/save.

You'd do this in a servlet.

Allistair

> -----Original Message-----
> From: nick sturm [mailto:[EMAIL PROTECTED]
> Sent: 24 August 2005 17:21
> To: Tomcat Users List
> Subject: newbie with a short question
> 
> 
> I am new to any web server, but hopefully this question is 
> easilly answered:
> 
> If I wanted to make a link to execute a .bat file locally on the
> server when a link is pressed, how would I do so?
> 
> I am making a pan/tiltable webcam and hope to use the siple 
> controls shown here:
> http://www.geocities.com/zoomkat/byte.htm
> 
> my major confusion stems from there not being a cgi directory.  (upon
> first inspection)
> 
> Sorry for my ignorance,
> -n
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to