Running a vbs from ASP

  • Thread starter Stan Sainte-Rose
  • Start date
S

Stan Sainte-Rose

Hi guys,

I would like to run a vbs script from an asp page.
I ve tried many directions but no one works..
The first was :
Dim oShell
Set oShell = Server.CreateObject("WSCript.shell")
i=oShell.run
("w:\wwwroot\look\j_consultation\j06_suivi\modules_stan\GenPDF.vbs 1 2 23,25
byAffaire N 1 FR (e-mail address removed)" )
Set oShell = Nothing



The second used AspExec componant
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application =
"w:\wwwroot\look\j_consultation\j06_suivi\modules_stan\GenPDF.vbs"
Executor.Parameters = "1 2 23,25 byAffaire N 1 FR (e-mail address removed)"
resultat=Executor.ExecuteWinApp

Thanks for your help



Stan
 
P

Patrice

This is the same language. Depending on what the script does, you could
likely just include the VBS file and call the function it exposes ?

BTW, it doesn't work but what is the behavior you see ? You could try with a
very simple script to see if it's the call from ASP or the script itself
that fails.
 
S

Stan Sainte-Rose

Hi Patrice,
In fact, with Aspexec, I get an "Access is denied" error..
About the vbs script, it generates a pdf doc and sends an email...

Any idea ?

Stan
 
A

Aaron [SQL Server MVP]

So, is ASP running as IUSR or as an authenticated user? Might try to run as
the latter, or else make sure that IUSR has proper permissions on the EXE
that is used to create the PDF file, and the folder where the PDF file will
be output.

A typical workaround for this is to have the ASP page simply store the "job"
information in a table, and an executable or VBS script wakes up every five
minutes, and processes any new jobs that have been added. This way, the
executable can be run as an administrator or power user, instead of a very
limited anonymous user. Not immediate real-time, but for e-mailing a PDF it
is probably close enough.
 
S

Stan Sainte-Rose

Aaron,
Thanks for your reply..
It's exactly what I did :)

Stan

--


---------------------------------------------------------------------
"Are you still wasting your time with spam?...
There is a solution!"

Protected by GIANT Company's Spam Inspector
The most powerful anti-spam software available.
http://mail.spaminspector.com
 

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

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top