Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 01:43 PM
Stan Sainte-Rose
Guest
 
Posts: n/a
Default 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 stan@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 stan@cyber97.com"
resultat=Executor.ExecuteWinApp

Thanks for your help



Stan





  #2  
Old July 19th, 2005, 01:43 PM
Patrice
Guest
 
Posts: n/a
Default Re: Running a vbs from ASP

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" <stan@cyber972.com> a écrit dans le message de
news:ecUKI9gTEHA.2128@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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[/color]
23,25[color=blue]
> byAffaire N 1 FR stan@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 stan@cyber97.com"
> resultat=Executor.ExecuteWinApp
>
> Thanks for your help
>
>
>
> Stan
>
>
>
>
>[/color]


  #3  
Old July 19th, 2005, 01:43 PM
Stan Sainte-Rose
Guest
 
Posts: n/a
Default Re: Running a vbs from ASP

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" <nobody@nowhere.com> a écrit dans le message de news:
ODTzTohTEHA.332@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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[/color]
a[color=blue]
> very simple script to see if it's the call from ASP or the script itself
> that fails.
>
>
> "Stan Sainte-Rose" <stan@cyber972.com> a écrit dans le message de
> news:ecUKI9gTEHA.2128@TK2MSFTNGP11.phx.gbl...[color=green]
> > 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[/color]
> 23,25[color=green]
> > byAffaire N 1 FR stan@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 stan@cyber97.com"
> > resultat=Executor.ExecuteWinApp
> >
> > Thanks for your help
> >
> >
> >
> > Stan
> >
> >
> >
> >
> >[/color]
>
>[/color]


  #4  
Old July 19th, 2005, 01:43 PM
Aaron [SQL Server MVP]
Guest
 
Posts: n/a
Default Re: Running a vbs from ASP

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" <stan@cyber972.com> wrote in message
news:eViZu9hTEHA.1984@TK2MSFTNGP12.phx.gbl...[color=blue]
> 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" <nobody@nowhere.com> a écrit dans le message de news:
> ODTzTohTEHA.332@TK2MSFTNGP11.phx.gbl...[color=green]
> > 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[/color][/color]
with[color=blue]
> a[color=green]
> > very simple script to see if it's the call from ASP or the script itself
> > that fails.
> >
> >
> > "Stan Sainte-Rose" <stan@cyber972.com> a écrit dans le message de
> > news:ecUKI9gTEHA.2128@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > 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[/color]
> > 23,25[color=darkred]
> > > byAffaire N 1 FR stan@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 stan@cyber97.com"
> > > resultat=Executor.ExecuteWinApp
> > >
> > > Thanks for your help
> > >
> > >
> > >
> > > Stan
> > >
> > >
> > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


  #5  
Old July 19th, 2005, 01:45 PM
Stan Sainte-Rose
Guest
 
Posts: n/a
Default Re: Running a vbs from ASP

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]" <ten.xoc@dnartreb.noraa> a écrit dans le message de
news: eUadZ3iTEHA.3752@TK2MSFTNGP12.phx.gbl...[color=blue]
> So, is ASP running as IUSR or as an authenticated user? Might try to run[/color]
as[color=blue]
> 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[/color]
will[color=blue]
> be output.
>
> A typical workaround for this is to have the ASP page simply store the[/color]
"job"[color=blue]
> information in a table, and an executable or VBS script wakes up every[/color]
five[color=blue]
> 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[/color]
it[color=blue]
> is probably close enough.
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "Stan Sainte-Rose" <stan@cyber972.com> wrote in message
> news:eViZu9hTEHA.1984@TK2MSFTNGP12.phx.gbl...[color=green]
> > 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" <nobody@nowhere.com> a écrit dans le message de news:
> > ODTzTohTEHA.332@TK2MSFTNGP11.phx.gbl...[color=darkred]
> > > This is the same language. Depending on what the script does, you[/color][/color][/color]
could[color=blue][color=green][color=darkred]
> > > 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[/color][/color]
> with[color=green]
> > a[color=darkred]
> > > very simple script to see if it's the call from ASP or the script[/color][/color][/color]
itself[color=blue][color=green][color=darkred]
> > > that fails.
> > >
> > >
> > > "Stan Sainte-Rose" <stan@cyber972.com> a écrit dans le message de
> > > news:ecUKI9gTEHA.2128@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[/color][/color][/color]
2[color=blue][color=green][color=darkred]
> > > 23,25
> > > > byAffaire N 1 FR stan@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 stan@cyber97.com"
> > > > resultat=Executor.ExecuteWinApp
> > > >
> > > > Thanks for your help
> > > >
> > > >
> > > >
> > > > Stan
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles