none
IIS6, cmd as cgi RRS feed

  • Allgemeine Diskussion

  • Hi folks,
     
    first of all, sorry I am write in english, but i did not found similar
    english writing group and I do not know german language.
     
    I am try to use CMD scripts as CGI with IIS6. I have configured IIS,
    this script provide me expected output in browser:
     
    @echo off
    echo Content-Type: text/html
    echo.
    echo ^<html^>^<head^>^</head^>^<body^>Hallo World ^</body^>^</html^>
    echo.
    echo ^<hr^>
    dir
    echo.
     
    Output display Hallo World and directoty listing (same as run from cmd
    console windows). But if I replace "dir" with "route", than only Hallo
    World" is dislaplayed and output of "route" is discarded. I discover the
    "route" command print it`s output into stderr instead of stdout, so I
    try redirect output to stdout with 2>&1 but this does not help. I have
    copied route.exe into same directory where mybatch.cmd reside, but this
    does not help.
     
    Am I did some mistake or system realy display output of one command but
    not the second one? Could does matter the dir is processed by cmd.exe
    but route.exe is standalone .exe??
     
    L.
     
     
    • Typ geändert Alex Pitulice Freitag, 21. Oktober 2011 10:55 Andere Sprache
    Freitag, 14. Oktober 2011 09:09

Alle Antworten

  • I paste wrong version of script, the version I actual experiment with:
     @echo off
       echo Content-Type: text/plain
       echo.
       echo Hello World!!
       echo.
       echo.
       dir
       echo.
       echo.
     L.
     
    On 14.10.2011 11:09, Petr Laznovsky wrote:
    > Hi folks,
    > first of all, sorry I am write in english, but i did not found similar
    > english writing group and I do not know german language.
    > I am try to use CMD scripts as CGI with IIS6. I have configured IIS,
    > this script provide me expected output in browser:
    > @echo off
    > echo Content-Type: text/html
    > echo.
    > echo ^<html^>^<head^>^</head^>^<body^>Hallo World ^</body^>^</html^>
    > echo.
    > echo ^<hr^>
    > dir
    > echo.
    > Output display Hallo World and directoty listing (same as run from cmd
    > console windows). But if I replace "dir" with "route", than only Hallo
    > World" is dislaplayed and output of "route" is discarded. I discover the
    > "route" command print it`s output into stderr instead of stdout, so I
    > try redirect output to stdout with 2>&1 but this does not help. I have
    > copied route.exe into same directory where mybatch.cmd reside, but this
    > does not help.
    > Am I did some mistake or system realy display output of one command but
    > not the second one? Could does matter the dir is processed by cmd.exe
    > but route.exe is standalone .exe??
    > L.
     
     
    Freitag, 14. Oktober 2011 09:21
  • Hello Petr,

    Thank you for your question.

    Please use the official Microsoft IIS Forum Platform located here: http://forums.iis.net/

    You can write your question in English and also find a great amount of useful ressources regarding IIS Technology.

     

    Thank you for your understanding.

    Alex

    Freitag, 21. Oktober 2011 10:55