473,394 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Running a vbs from ASP

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 st**@cyber97.com" )
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 st**@cyber97.com"
resultat=Executor.ExecuteWinApp

Thanks for your help

Stan

Jul 19 '05 #1
4 6846
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.
"Stan Sainte-Rose" <st**@cyber972.com> a écrit dans le message de
news:ec**************@TK2MSFTNGP11.phx.gbl...
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 st**@cyber97.com" )
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 st**@cyber97.com"
resultat=Executor.ExecuteWinApp

Thanks for your help

Stan


Jul 19 '05 #2
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

--
"Patrice" <no****@nowhere.com> a écrit dans le message de news:
OD*************@TK2MSFTNGP11.phx.gbl...
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.
"Stan Sainte-Rose" <st**@cyber972.com> a écrit dans le message de
news:ec**************@TK2MSFTNGP11.phx.gbl...
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 st**@cyber97.com" )
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 st**@cyber97.com"
resultat=Executor.ExecuteWinApp

Thanks for your help

Stan



Jul 19 '05 #3
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.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...
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

--
"Patrice" <no****@nowhere.com> a écrit dans le message de news:
OD*************@TK2MSFTNGP11.phx.gbl...
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.
"Stan Sainte-Rose" <st**@cyber972.com> a écrit dans le message de
news:ec**************@TK2MSFTNGP11.phx.gbl...
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 st**@cyber97.com" )
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 st**@cyber97.com"
resultat=Executor.ExecuteWinApp

Thanks for your help

Stan




Jul 19 '05 #4
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
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> a écrit dans le message de
news: eU**************@TK2MSFTNGP12.phx.gbl...
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.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Stan Sainte-Rose" <st**@cyber972.com> wrote in message
news:eV**************@TK2MSFTNGP12.phx.gbl...
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

--
"Patrice" <no****@nowhere.com> a écrit dans le message de news:
OD*************@TK2MSFTNGP11.phx.gbl...
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.
"Stan Sainte-Rose" <st**@cyber972.com> a écrit dans le message de
news:ec**************@TK2MSFTNGP11.phx.gbl...
> 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 st**@cyber97.com" )
> 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 st**@cyber97.com"
> resultat=Executor.ExecuteWinApp
>
> Thanks for your help
>
>
>
> Stan
>
>
>
>
>



Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ross Presser | last post by:
OK, I've been researching this problem and can't find a definitive answer yet. The situation is one that seems to have come up a few times to different folks. I am writing an application that...
4
by: Bill Dika | last post by:
Hi I am trying to calculate a running total of a calculated textbox (tbAtStandard) in GroupFooter1 for placement in a textbox (tbTotalAtStandard) on my report in Groupfooter0. The problem...
1
by: Ennio-Sr | last post by:
Hi all! Testing a script where I need to make sure that postgresql is running before passing a <psql dbasename -c "insert into ..." > instruction I faced this curious behaviour: This is the...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
7
by: pradeep_TP | last post by:
hello all, I want to know how can I check whether a web site us running or not. I have used HttpWebRequest but when I give a web site address, It takes few number of seconds to throw exception...
3
by: Anil Kumar Sharma | last post by:
Hello, I am working on C# using vs.net 2003. I have faced two interesting problems. 1. Dynamically setting Default Button: I created a form and used it in various contexts. On basis of the...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
16
by: Gandalf186 | last post by:
I need to create a query that produces running totals for every group within my table for example i wish to see: - Group A 1 5 9 15 Group B
2
by: upperclass | last post by:
Hi, I'm trying to find a decent way to measure program running time. I know clock() is probably the standard way of doing it but clock_t overflows too quickly. The target program running time...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.