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. Advertisements

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. Shawn Mehaffie
    Replies:
    4
    Views:
    840
    Shawn Mehaffie
    Jan 22, 2004
  2. =?Utf-8?B?RHVzdGluIElJLg==?=

    Calling a client side script from server side.

    =?Utf-8?B?RHVzdGluIElJLg==?=, Aug 13, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    8,208
    Levi Rosol
    Aug 16, 2004
  3. Mortar
    Replies:
    4
    Views:
    2,410
    Mortar
    Jan 25, 2005
  4. Magnus Blomberg
    Replies:
    3
    Views:
    962
    Magnus Blomberg
    Apr 14, 2005
  5. keithb
    Replies:
    0
    Views:
    764
    keithb
    Feb 16, 2006
  6. Replies:
    1
    Views:
    1,124
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2007
  7. ShilpaM
    Replies:
    1
    Views:
    354
    Joe Kaplan
    Jan 18, 2007
  8. JT
    Replies:
    5
    Views:
    345
    Ray Costanzo [MVP]
    Sep 10, 2004
Loading...