all groups > iis security > october 2004 >
You're in the

iis security

group:

IIS 6.0 can't serve multiple .bat files - 404 error


IIS 6.0 can't serve multiple .bat files - 404 error Steve Ricketts
10/30/2004 9:41:22 AM
iis security:
We have an application that creates potentially 1,000's of unique .bat files
in a Virtual Directory based on user and site information. When the .asp is
called, the File Scripting Object creates a .bat file based on information
about the user and places it in the physical location referenced by the
Virtual Directly. The .asp then creates a link to that file so the user can
click on it and open the .bat file. With the move to Server 2003, IIS 6.0
is giving a 404 error when that link is referenced, and obviously it exists
so it's not recognizing the extension.

I'm aware that IIS 6.0 needs to know the extensions of a file before it will
recognize them and that you can identify extentions in the Internet
Information Services Manager by defining a new Web Service Extension, but
only for a specific file.

Is there any way to allow the downloading of all .bat files?

Thanks,

Steve Ricketts

Re: IIS 6.0 can't serve multiple .bat files - 404 error Jonathan Maltz [MS-MVP]
10/30/2004 1:46:36 PM
Hi,

It looks like you have some terms confused. A web service extension allows
IIS to use an application to process a file on the server (like allowing
ASP, in order to have .asp files processed by the ASP compiler/server).
What you want is a MIME Type setting in order to serve all .bat files

In the IIS Manager, expand the computer's name, and the "Web Sites" folder,
then right-click the website which you would like to allow .bat files to be
served on, and select "Properties". Alternatively, you can right click on
the "Web Sites" folder and select "Properties" to apply these settings to
all of the websites hosted on the computer, instead of applying the settings
website by website.

In the Properties screen, click on the "HTTP Headers" tab. On the bottom of
this property page, click the "MIME Types." button. A list of the custom
MIME types set on this computer will now be displayed. On the right side of
the MIME type window click the "New." button. Since you want to allow .bat
sites to be served, type the extension ".bat" (without the quotes) into the
first text box. In the "MIME type" text box, type "text/plain" (without the
quotes) and press the "OK" button on both of the dialogs, and "Apply" on the
Properties window.

--
--Jonathan Maltz [Microsoft MVP - Windows Server - IIS, Virtual PC]
http://www.visualwin.com - A Windows Server 2003 visual, step-by-step
tutorial site :-)
http://vpc.visualwin.com - Does <insert OS name> work on VPC 2004? Find out
here
Only reply by newsgroup. I do not do technical support via email. Any
emails I have not authorized are deleted before I see them.


[quoted text, click to view]

Re: IIS 6.0 can't serve multiple .bat files - 404 error Steve Ricketts
10/30/2004 2:00:58 PM
Outstanding!! Yeah, I have a lot of things confused, but as long as I can
find the answers as good as this I'm not complaining! Your directions did
the trick and thanks a ton for responding so quickly and so well.

Regards,

Steve


[quoted text, click to view]

Re: IIS 6.0 can't serve multiple .bat files - 404 error waynea NO[at]SPAM tek.com
12/13/2004 4:07:57 PM
Hi Jonathon -
I followed your instructions and added MIME extensions for .bat,
..cmd, and .xnk. It worked for the .xnk extension.

However, I still receive the same 404 error when I click on a test .cmd
or .bat file. I can see the file because 'directory browsing' is on.
However, when I click on the .cmd or .bat file, I'm still denied
access. Any other suggestions would be greatly appreciated. I too am
using Windows 2003 Server and IIS6.


Thanks!


[quoted text, click to view]
Re: IIS 6.0 can't serve multiple .bat files - 404 error Jonathan Maltz [MS-MVP]
12/14/2004 12:50:06 AM
Hi,

Turn off Internet Explorer's friendly error messages (Tools -> Internet
Options -> Advanced) and paste the real error

Also, do you have anything like UrlScan installed?

--
--Jonathan Maltz [Microsoft MVP - Windows Server - IIS, Virtual PC]
http://www.visualwin.com - A Windows Server 2003 visual, step-by-step
tutorial site :-)
http://vpc.visualwin.com - Does <insert OS name> work on VPC 2004? Find out
here
Only reply by newsgroup. I do not do technical support via email. Any
emails I have not authorized are deleted before I see them.


[quoted text, click to view]

Re: IIS 6.0 can't serve multiple .bat files - 404 error waynea NO[at]SPAM tek.com
12/14/2004 2:10:22 PM

Hi Bernard -
I pasted the end of the log below. I think it's '2'

Let me know if I copied the wrong part of the logfile.
Thanks!!

sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken
404 2 1260 1830 312 10
Re: IIS 6.0 can't serve multiple .bat files - 404 error waynea NO[at]SPAM tek.com
12/14/2004 2:20:53 PM
Johnathon and Bernard -
Looks like it's working now. I went back and checked the
configuration and I had added .cmd / .bat as an "application extension"
(Via IIS Admin - Properties of site - Directory / Home Directory tab -
Configuration - Mappings). After I removed it, my files started
exectuing again. I'll let you know if I run into other questions.

Johnathon - thanks for the tip on the 'friendly' error messages. I
didn't know that checkbox even existed.
Thanks again for your replies.
Re: IIS 6.0 can't serve multiple .bat files - 404 error Bernard
12/14/2004 3:28:35 PM
what's the sub status code of the request ? look at IIS log file

--
Regards,
Bernard Cheah
http://www.tryiis.com/
http://support.microsoft.com/
http://www.msmvps.com/bernard/



[quoted text, click to view]

Re: IIS 6.0 can't serve multiple .bat files - 404 error Bernard
12/15/2004 2:18:25 PM
404.2 is dynamic extenstion not enabled.
404.3 is unknown mime type.

why you get 404.2? are you trying to execute it ?

--
Regards,
Bernard Cheah
http://www.tryiis.com/
http://support.microsoft.com/
http://www.msmvps.com/bernard/



[quoted text, click to view]

AddThis Social Bookmark Button