How to Use a CMD or BAT File as a CGI ScriptID: Q164674
|
Internet Information Server 1.0 (IIS) can use .cmd or .bat files as CGI scripts. In IIS 2.0 and 3.0, this capability has been removed by default.
You can enable the use of .cmd and .bat files with IIS by adding a script
mapping to the registry.
WARNING: Using Registry Editor incorrectly can cause serious problems that
may require you to reinstall Windows. Microsoft cannot guarantee that
problems resulting from the incorrect use of Registry Editor can be
solved. Use Registry Editor at your own risk.
For information about how to edit the registry, view the "Changing Keys And
Values" online Help topic in Registry Editor (Regedit.exe) or the "Add and
Delete Information in the Registry" and "Edit Registry Data" online Help
topics in Regedt32.exe. Note that you should back up the registry before
you edit it.
\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script Map
Value Name: .CMD
Data Type: REG_SZ
String:
"\Winnt\system32\cmd.exe /c %s %s" (Leave off the quotation marks)
For .BAT files, repeat this process and substitute .BAT for .CMD in the
value name.
@echo off
echo Content-Type: text/plain
echo.
echo Hello World!!
echo.
echo.
http://servername/scripts/myscript.cmd
Keywords : iishowto iisscript
Version : WinNT:2.0,3.0
Platform : winnt
Issue type :
Last Reviewed: April 29, 1999