469,645 Members | 1,641 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Executing a PERL script from ASP.NET appl.

Hey 2gether!

I'm trying to execute a PERL script on the web server when the user presses
a button in an ASP.NET Web Application using Visual Basic. The most obvious
solution for me seemed to be to use the 'Shell()'-command [Like this:
Shell("C:\\Inetpub\\wwwroot\\BasicDataRequests\\Ro bot.pl",
AppWinStyle.NormalNoFocus, True, 5000)].
This didn't work: Either I get an "File not found" error, or I get no error
at all, but the PERL script isn't executed anyway. The strange thing is that
I managed to execute a .bat file for example. Why the hell can't I execute
the PERL script?
Just to make sure, I also tried:
Shell("C:\\Perl\\bin\\perl.exe
C:\\Inetpub\\wwwroot\\BasicDataRequests\\Robot.pl" ,
AppWinStyle.NormalNoFocus, True, 5000)
... to make sure he can find the PERL-interpreter.

Has anyone got a clue, what the problem is? (Security? Userrights? Wrong
path? etc. etc.?) Or has anyone got a different solution for this problem
(target: Execute PERL script out of ASP.NET appl. using VB)?

I've read that with the PerlASPX module you can run PERL in ASP.NET, but
that costs 295$. Maybe there are any other known, free products..?

Thanks alot in before!
Jul 21 '05 #1
3 4571
You realize that executing applications from web pages is probably a bad
idea, right?

If you can execute the command interpreter then you should be able to run
the Perl one as well, though maybe the issue is quotes around the arguments
or something like that.

If you install ActivePerl you can use Perl in IIS either in "CGI" mode or as
a scripting language in ASP pages or under its own IIS handler (pages that
have the .plx extension).

I'd recommend the latter if your Perl script can run under IIS.
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"PzYon" <Pz***@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
Hey 2gether!

I'm trying to execute a PERL script on the web server when the user presses a button in an ASP.NET Web Application using Visual Basic. The most obvious solution for me seemed to be to use the 'Shell()'-command [Like this:
Shell("C:\\Inetpub\\wwwroot\\BasicDataRequests\\Ro bot.pl",
AppWinStyle.NormalNoFocus, True, 5000)].
This didn't work: Either I get an "File not found" error, or I get no error at all, but the PERL script isn't executed anyway. The strange thing is that I managed to execute a .bat file for example. Why the hell can't I execute
the PERL script?
Just to make sure, I also tried:
Shell("C:\\Perl\\bin\\perl.exe
C:\\Inetpub\\wwwroot\\BasicDataRequests\\Robot.pl" ,
AppWinStyle.NormalNoFocus, True, 5000)
.. to make sure he can find the PERL-interpreter.

Has anyone got a clue, what the problem is? (Security? Userrights? Wrong
path? etc. etc.?) Or has anyone got a different solution for this problem
(target: Execute PERL script out of ASP.NET appl. using VB)?

I've read that with the PerlASPX module you can run PERL in ASP.NET, but
that costs 295$. Maybe there are any other known, free products..?

Thanks alot in before!

Jul 21 '05 #2
How about trying Process.Start(). ?

http://cheeso.members.winisp.net/src...e=shellex.aspx
"Klaus H. Probst" <us*******@simulplex.net> wrote in message
news:OH****************@TK2MSFTNGP09.phx.gbl...
You realize that executing applications from web pages is probably a bad
idea, right?

If you can execute the command interpreter then you should be able to run
the Perl one as well, though maybe the issue is quotes around the
arguments
or something like that.

If you install ActivePerl you can use Perl in IIS either in "CGI" mode or
as
a scripting language in ASP pages or under its own IIS handler (pages that
have the .plx extension).

I'd recommend the latter if your Perl script can run under IIS.
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"PzYon" <Pz***@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
Hey 2gether!

I'm trying to execute a PERL script on the web server when the user

presses
a button in an ASP.NET Web Application using Visual Basic. The most

obvious
solution for me seemed to be to use the 'Shell()'-command [Like this:
Shell("C:\\Inetpub\\wwwroot\\BasicDataRequests\\Ro bot.pl",
AppWinStyle.NormalNoFocus, True, 5000)].
This didn't work: Either I get an "File not found" error, or I get no

error
at all, but the PERL script isn't executed anyway. The strange thing is

that
I managed to execute a .bat file for example. Why the hell can't I
execute
the PERL script?
Just to make sure, I also tried:
Shell("C:\\Perl\\bin\\perl.exe
C:\\Inetpub\\wwwroot\\BasicDataRequests\\Robot.pl" ,
AppWinStyle.NormalNoFocus, True, 5000)
.. to make sure he can find the PERL-interpreter.

Has anyone got a clue, what the problem is? (Security? Userrights? Wrong
path? etc. etc.?) Or has anyone got a different solution for this problem
(target: Execute PERL script out of ASP.NET appl. using VB)?

I've read that with the PerlASPX module you can run PERL in ASP.NET, but
that costs 295$. Maybe there are any other known, free products..?

Thanks alot in before!


Jul 21 '05 #3
Hi Dino -

I believe the VB "Shell" command is just a wrapper around Process.Start. In
any case if the target EXE has a problem with the command line format (the
Perl interpreter is touchy about this, I know) or he has a permissions issue
or something like that it won't work no matter what.

It's still a bad idea to run EXEs from web processes though =)
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message
news:u3**************@TK2MSFTNGP09.phx.gbl...
How about trying Process.Start(). ?

http://cheeso.members.winisp.net/src...e=shellex.aspx
"Klaus H. Probst" <us*******@simulplex.net> wrote in message
news:OH****************@TK2MSFTNGP09.phx.gbl...
You realize that executing applications from web pages is probably a bad
idea, right?

If you can execute the command interpreter then you should be able to run the Perl one as well, though maybe the issue is quotes around the
arguments
or something like that.

If you install ActivePerl you can use Perl in IIS either in "CGI" mode or as
a scripting language in ASP pages or under its own IIS handler (pages that have the .plx extension).

I'd recommend the latter if your Perl script can run under IIS.
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"PzYon" <Pz***@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
Hey 2gether!

I'm trying to execute a PERL script on the web server when the user

presses
a button in an ASP.NET Web Application using Visual Basic. The most

obvious
solution for me seemed to be to use the 'Shell()'-command [Like this:
Shell("C:\\Inetpub\\wwwroot\\BasicDataRequests\\Ro bot.pl",
AppWinStyle.NormalNoFocus, True, 5000)].
This didn't work: Either I get an "File not found" error, or I get no

error
at all, but the PERL script isn't executed anyway. The strange thing is

that
I managed to execute a .bat file for example. Why the hell can't I
execute
the PERL script?
Just to make sure, I also tried:
Shell("C:\\Perl\\bin\\perl.exe
C:\\Inetpub\\wwwroot\\BasicDataRequests\\Robot.pl" ,
AppWinStyle.NormalNoFocus, True, 5000)
.. to make sure he can find the PERL-interpreter.

Has anyone got a clue, what the problem is? (Security? Userrights? Wrong path? etc. etc.?) Or has anyone got a different solution for this problem (target: Execute PERL script out of ASP.NET appl. using VB)?

I've read that with the PerlASPX module you can run PERL in ASP.NET, but that costs 295$. Maybe there are any other known, free products..?

Thanks alot in before!



Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by SS | last post: by
1 post views Thread by amaltasb | last post: by
1 post views Thread by Balajisanthanakrishnan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.