_run.bat not doing its job

Help
2008-05-01
2013-04-18
  • Matthew Danihy
    Matthew Danihy
    2008-05-01

    I am getting a 401.2 error when the .bat file runs.  Not sure what permission I am missing.  Server 2003 running IIS.

    Thanks...

     
    • This is correct. You are trying to execute "_run.bat" via IIS and it isn't possible (in fact, whole "data" directory is inaccessible over web).
      You should execute "_run.bat" as any other application / script on your server. Use "Scheduled tasks" or just run it manuale from command line or explorer.

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-02

      I did try to run it as a Scheduled Task and that is when I get the error. 

      If I take the commands and run them in the address bar of IE, it works (to some extent). 

      Running it from the command line, line by line and I get the same error, a HTML response that states I do not have permission to access the web site.

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-02

      ADDITION:

      401.1 Invalid credentials is the error.  I gave everyone the greatest amount of power on that server, and I still get that error.

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-02

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
      <HTML><HEAD><TITLE>You are not authorized to view this page</TITLE>
      <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
      <STYLE type="text/css">
        BODY { font: 8pt/12pt verdana }
        H1 { font: 13pt/15pt verdana }
        H2 { font: 8pt/12pt verdana }
        A:link { color: red }
        A:visited { color: maroon }
      </STYLE>
      </HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>

      <h1>You are not authorized to view this page</h1>
      You do not have permission to view this directory or page using the credentials that you supplied.
      <hr>
      <p>Please try the following:</p>
      <ul>
      <li>Contact the Web site administrator if you believe you should be able to view this directory or page.</li>
      <li>Click the <a href="javascript:location.reload()">Refresh</a> button to try again with different credentials.</li>
      </ul>
      <h2>HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.<br>Internet Information Services (IIS)</h2>
      <hr>
      <p>Technical Information (for support personnel)</p>
      <ul>
      <li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>401</b>.</li>
      <li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
      and search for topics titled <b>Authentication</b>, <b>Access Control</b>, and <b>About Custom Error Messages</b>.</li>
      </ul>

      </TD></TR></TABLE></BODY></HTML>
      Microsoft (R) Windows Script Host Version 5.7
      Copyright (C) Microsoft Corporation. All rights reserved.

      Running WMI-EVENTS.vbs ...
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
      <HTML><HEAD><TITLE>You are not authorized to view this page</TITLE>
      <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
      <STYLE type="text/css">
        BODY { font: 8pt/12pt verdana }
        H1 { font: 13pt/15pt verdana }
        H2 { font: 8pt/12pt verdana }
        A:link { color: red }
        A:visited { color: maroon }
      </STYLE>
      </HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>

      <h1>You are not authorized to view this page</h1>
      You do not have permission to view this directory or page using the credentials that you supplied.
      <hr>
      <p>Please try the following:</p>
      <ul>
      <li>Contact the Web site administrator if you believe you should be able to view this directory or page.</li>
      <li>Click the <a href="javascript:location.reload()">Refresh</a> button to try again with different credentials.</li>
      </ul>
      <h2>HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.<br>Internet Information Services (IIS)</h2>
      <hr>
      <p>Technical Information (for support personnel)</p>
      <ul>
      <li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>401</b>.</li>
      <li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
      and search for topics titled <b>Authentication</b>, <b>Access Control</b>, and <b>About Custom Error Messages</b>.</li>
      </ul>

      </TD></TR></TABLE></BODY></HTML>

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-02

      I seem to be having a conversation with myself.  :)

      I ran http://localhost/bat-prepare.php?secret=v5n6i7 with Internet Explorer and it worked fine.

      cscript wmi-events.vbs ran fine from cmd.exe

      and http://localhost/cron.php?secret=v5n6i7 ran fine in IE as well.

      All this was done on the server and same login as when trying to run the _Run.bat file.

      I hope this is enough information for you...

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-02

      More information for you.  using the verbose option in curl:

      * About to connect() to localhost port 80
      *   Trying 127.0.0.1... connected
      * Connected to localhost (127.0.0.1) port 80
      > GET /bat-prepare.php?secret=v5n6i7 HTTP/1.1
      > User-Agent: curl/7.15.4 (i586-pc-mingw32msvc) libcurl/7.15.4 zlib/1.2.2
      > Host: localhost
      > Accept: */*
      >
      < HTTP/1.1 401 Unauthorized
      < Content-Length: 1539
      < Content-Type: text/html
      < Server: Microsoft-IIS/6.0
      < WWW-Authenticate: NTLM
      < X-Powered-By: ASP.NET
      < Date: Fri, 02 May 2008 19:21:14 GMT

       
    • nice diagnostic :D

      The problem is simple... Your IIS configuration doesn't know, that localhost is the same web as your SBELM web.
      You have two options...
      Set Localhost as alias to your SBELM web
      or
      Change "_run.bat"... rewrite "localhost" (or 127.0.0.1) with full name of webserver (same as you are using to access to access SBELM).

      This should help.

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-05

      I thought that too, I changed it to the name of the server and the ip address, I get the same problem.  I even tried to run it on another computer on the network, same message.

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-05

      What confuses me is that I can run the website from the browser no problem, just when curl runs it doesn't work. 

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-05

      The IIS log:

      #Software: Microsoft Internet Information Services 6.0
      #Version: 1.0
      #Date: 2008-05-05 13:08:51
      #Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status
      2008-05-05 13:08:51 W3SVC664338953 10.10.2.161 GET /bat-prepare.php secret=v5n6i7 80 - 10.10.2.161 curl/7.15.4+(i586-pc-mingw32msvc)+libcurl/7.15.4+zlib/1.2.2 401 1 0
      2008-05-05 13:08:51 W3SVC664338953 10.10.2.161 GET /cron.php secret=v5n6i7 80 - 10.10.2.161 curl/7.15.4+(i586-pc-mingw32msvc)+libcurl/7.15.4+zlib/1.2.2 401 1 0
      2008-05-05 13:09:06 W3SVC664338953 10.10.2.161 GET /bat-prepare.php secret=v5n6i7 80 - 10.10.2.161 curl/7.15.4+(i586-pc-mingw32msvc)+libcurl/7.15.4+zlib/1.2.2 401 1 0
      2008-05-05 13:09:06 W3SVC664338953 10.10.2.161 GET /cron.php secret=v5n6i7 80 - 10.10.2.161 curl/7.15.4+(i586-pc-mingw32msvc)+libcurl/7.15.4+zlib/1.2.2 401 1 0
      2008-05-05 13:09:50 W3SVC664338953 10.10.2.161 GET /bat-prepare.php secret=v5n6i7 80 - 10.10.2.161 curl/7.15.4+(i586-pc-mingw32msvc)+libcurl/7.15.4+zlib/1.2.2 401 1 0
      2008-05-05 13:09:50 W3SVC664338953 10.10.2.161 GET /cron.php secret=v5n6i7 80 - 10.10.2.161 curl/7.15.4+(i586-pc-mingw32msvc)+libcurl/7.15.4+zlib/1.2.2 401 1 0

      Seems like curl is not passing a username.

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-05

      Not sure if this is the correct way, but I changed the default anonymous user in IIS to an administrator account and it worked after that. 

       
    • this can be problem of cURL.exe
      Can You please try to download and use latests version from http://curl.haxx.se/download.html and let me know?

       
    • Matthew Danihy
      Matthew Danihy
      2008-05-07

      Ahh, before making the change to the anonymous user, that is exactly what I did.  I probably should have added that to my last message.

      I had the same problems, which is what prompted me to just make the anonymous user the admin.

      The version I grabbed was:

      Win32 2000/XP    7.18.1    libcurl        Günter Knauf