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

M

mto32

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top