Problem with execute program in ASP

Discussion in 'ASP General' started by DanC, Jan 6, 2005.

  1. DanC

    DanC Guest

    I try to execute a program in ASP but i get an error.
    Even with script below i get 1 as result.
    What's wrong?
    Pse help, i'm new in ASP.
    greets
    DanC



    <%@ LANGUAGE="JSCript" %>
    <%
    var WshShell = new ActiveXObject("WScript.Shell");

    var oExec = WshShell.run("cmd /C \"ren :\\sss\\back.js
    back2.js\"",0,"TRUE");
    if (oExec==0)
    {
    Response.Write("it works!");
    }
    else
    {
    Response.Write(oExec);
    }

    %>
     
    DanC, Jan 6, 2005
    #1
    1. Advertising

  2. DanC

    DanC Guest

    errata

    Previous code wasn't good. But has nothing to do with the error.

    <%@ LANGUAGE="JSCript" %>
    <%
    var WshShell = new ActiveXObject("WScript.Shell");

    var oExec = WshShell.run("cmd /C \"ren c:\\sss\\back.js
    back2.js\"",0,"TRUE");
    if (oExec==0)
    {
    Response.Write("it works!");
    }
    else
    {
    Response.Write(oExec);
    }

    %>
     
    DanC, Jan 6, 2005
    #2
    1. Advertising

  3. "DanC" <> wrote in message
    news:...
    > I try to execute a program in ASP but i get an error.
    > Even with script below i get 1 as result.
    > What's wrong?
    > Pse help, i'm new in ASP.
    > greets
    > DanC
    >
    >
    >
    > <%@ LANGUAGE="JSCript" %>
    > <%
    > var WshShell = new ActiveXObject("WScript.Shell");


    see http://www.aspfaq.com/show.asp?id=2059
     
    Tom Kaminski [MVP], Jan 6, 2005
    #3
  4. DanC

    DanC Guest

    It helped but have now

    CScript Error: Loading your settings failed. (access denied)

    The used code is now

    <% Response.Buffer = true %>
    <%
    Set objWShell = CreateObject("WScript.Shell")
    Set objCmd = objWShell.Exec("\\Dc_test\SSS\cscript.exe
    \\Dc_test\SSS\sasysdag.js /?")
    strPResult = objCmd.StdOut.Readall()
    set objCmd = nothing: Set objWShell = nothing
    response.write ".<br>" & replace(strPResult,vbCrLf,"<br>")
    %>

    It looks like i'm not far of the problem
     
    DanC, Jan 6, 2005
    #4
  5. DanC

    DanC Guest

    Set objCmd = objWShell.Exec("cscript /?")

    what should give the help of cscript, give also
    CScript Error: Loading your settings failed. (access denied)
     
    DanC, Jan 6, 2005
    #5
  6. DanC

    DanC Guest

    problem solved

    It has nothing to do with permissions or exc.
    It was a setting in the properties of the website in IIS.
    There were only permisions to scripts. And not to scripts and executable
    files.

    Tnx anyway for reply.
    Greets
    DanC
     
    DanC, Jan 6, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Bokma
    Replies:
    5
    Views:
    5,133
    John Bokma
    Sep 10, 2003
  2. Chris
    Replies:
    4
    Views:
    3,706
    Chris
    Nov 27, 2003
  3. =?Utf-8?B?QW5kcmV3RG90SGF5?=

    XmlSerializer - Cannot execute a program csc.exe

    =?Utf-8?B?QW5kcmV3RG90SGF5?=, Jun 13, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    4,268
    =?Utf-8?B?U2ltb25lIENoaWFyZXR0YQ==?=
    Aug 4, 2004
  4. Mary Kerrigan

    "Cannot execute a program" error: vbc.exe

    Mary Kerrigan, Sep 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,867
    Ken Dopierala Jr.
    Sep 24, 2004
  5. Savas Ates
    Replies:
    1
    Views:
    287
    Patrice
    Aug 17, 2004
Loading...

Share This Page