ASP - Server-side script requires server to be logged in

Discussion in 'ASP General' started by mto32, Mar 24, 2009.

  1. mto32

    mto32 Guest

    I'm trying to add a simple 'server side' script to an ASP page. If I run it
    with the server logged in, it works fine (a DOS window flashes on the
    server). If the server isn't logged in, it doesn't work. I've played with
    different methods (wscript.shell & ASPExec), but neither works. Using the
    wscript.shell method, I see Event ID 26 (application popup: cmd.exe
    Application Error: the application failed to initialize properly). My
    IUSR_SERVER account is in the 'Domain Admins' group. See a basic 'sample'
    code below. Thanks in advance for any assistance.

    set WshShell = Server.CreateObject("Wscript.Shell")
    dim ShellCommand
    ShellCommand = "cmd /c dir c:\ > d:\inetpub\wwwroot\adtools\TEST.txt"
    WshShell.run ShellCommand
    set WshShell = nothing

    ================= or =====================

    Set ObjExecutor = Server.CreateObject("ASPExec.Execute")
    ObjExecutor.Application = "cmd.exe"
    ObjExecutor.Parameters = "/c dir c:\ > d:\inetpub\wwwroot\adtools\TEST.txt"
    ObjExecutor.ShowWindow = False
    x=ObjExecutor.ExecuteWinApp
     
    mto32, Mar 24, 2009
    #1
    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. Magnus Blomberg
    Replies:
    3
    Views:
    740
    Magnus Blomberg
    Apr 14, 2005
  2. keithb
    Replies:
    0
    Views:
    658
    keithb
    Feb 16, 2006
  3. Amit_Basnak
    Replies:
    5
    Views:
    1,251
    Amit_Basnak
    Feb 2, 2007
  4. Replies:
    1
    Views:
    972
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2007
  5. ShilpaM
    Replies:
    1
    Views:
    283
    Joe Kaplan
    Jan 18, 2007
Loading...

Share This Page