Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cscript from ASP vs. cscript from cmd prompt

Status
Not open for further replies.

ppepin

IS-IT--Management
Mar 13, 2001
36
0
0
US
I'm looking for some assistance with the following:

If have a .vbs script that creates/manipulates some objects.

Simple example:
test.vbs
DIM oDistiller

on error resume next

WScript.Echo "Creating distiller object..."
Set oDistiller = CreateObject("PDFDistiller.PDFDistiller.1")
WScript.Echo "Done creating distiller object..."

If oDistiller Is Nothing Then
WScript.Echo "Error: Cannot create PDF document. Adobe Acrobat Distiller is not available! Quiting..."
WScript.Quit 1
End If

When run from a command prompt i.e.:
cscript test.vbs
it works just fine and the object is created.

However, if I run this from a WScript.Shell command on an ASP page, the object is not created:

Example:
<%
set wshShell = Server.CreateObject(&quot;WScript.Shell&quot;)
wshShell.Run &quot;C:\test.bat&quot;, 0, True
set wshShell=Nothing
%>

Test.Bat
@ECHO OFF
echo ============================ Start ======================================= >> c:\test.log
date /t >> c:\test.log
time /t >> c:\test.log
cscript c:\test.vbs >> c:\test.log
echo ============================= End ======================================= >> c:\test.log

Here is the output of the test.log file:
============================ Start =======================================
Wed 01/21/2004
1:29p
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Creating distiller object...
Done creating distiller object...
Error: Cannot create PDF document. Adobe Acrobat Distiller is not available! Quiting...
============================= End =======================================

Anybody have any ideas of why this is failing? All help would be appreciated.

Thanks.
 
Your webpage user is default IUSR_<servername>.
This user is default limited, because you don't want us doing funny things with your system. Especially WScript.Shell is 'dangerous'.
So i suggest the security settings...

hth,
Foxbox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top