Execute Windows program from Perl script (??)

J

Jürgen Exner

Tony said:
Now *this* is the type of thing I was hoping for.

But it is not what you asked about. You asked explicitely
<quote>
What I want is to launch a (Windows) program from a perl script and
for the perl script to continue on. [...]
Does anyone have info on how to (whether I can) get perl to execute an
external program and continue on?
</quote>

Now, why are you surprised when people are trying to answer the question you
actually asked rather then trying to guess what you might have been hoping
for?

jue
 
K

kevincar

Well, I'm going to take the easy way out.

I'll just write something to a file with perl, and have the scheduler
watch for that file to be modified.

Then the scheduler program can start the external program.

Thank you to everyone who participated. I really do appreciate the
feedback, regardless of whether it helped or not.

Hi all,
Lucky me, I just ran into this problem this morning, so I thought
I'd chime in on how I got mine to work ... It's really more of
an Apache config question, but what the hey; Perl is the most used
CGI program anyway (AFAIK).

My Simple problem description; I have a VB program that I wanted
a user to be able to run on my Apache/Perl equipped server -
I tried this originally with a 1-liner Perl CGI script;

#!c:/Perl/perl.exe -w
system("m:/bah/blah/vbrunprogram.exe");

....obviously, it was installed under cgi-bin and it was a
UNIX-style ascii file and all that stuff - It worked when I
called it from a command window but my Apache logs always
said "Access Denied" when called from a brower.


There were two things going on;
First, it was a file on a networked drive and apache didn't
know the first thing about what to do with it-

Second; Apache doesn't use your logon account; It *could*, but
it DEFINITELY is not very adviseable!!!

I solved the problem by having the cgi "1-liner" script call
a DOS bat file with a "net use" wrapper around it;

C:\cat script.bat
NET USE M: \\machine\mtpoint
m:/bah/blah/vbrunprogram.exe
NET USE M: /DELETE

....and change the script to call the bat file;
#!c:/Perl/perl.exe -w
system("script.bat");

Be warned; the "system" call will dump everything from the
BAT file onto the user's brower- don't put any embarassing
comments in it!

Hope this helps,
K.c
 

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,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top