Starting a Perl script with no command prompt window

P

PeteOlcott

Does anyone know how to start a Perl script as an MS Windows XP Pro
"Scheduled Task" and either have no "command prompt" window, or have
the "command prompt" window be created as minimized?
 
C

ccc31807

Does anyone know how to start a Perl script as an MS Windows XP Pro
"Scheduled Task" and either have no "command prompt" window, or have
the "command prompt" window be created as minimized?

Create a batch file that runs the Perl script. Schedule the batch file
as a scheduled task.

CC
 
J

Jürgen Exner

PeteOlcott said:
Does anyone know how to start a Perl script as an MS Windows XP Pro
"Scheduled Task"

Same as any other scheduled task.
and either have no "command prompt" window, or have
the "command prompt" window be created as minimized?

Call wperl.exe (part of AcitveState Perl) instead of perl.exe as the
interpreter.

jue
 
B

Ben Morrow

Quoth PeteOlcott said:
Does anyone know how to start a Perl script as an MS Windows XP Pro
"Scheduled Task" and either have no "command prompt" window, or have
the "command prompt" window be created as minimized?

If you use wperl.exe instead of perl.exe, you don't get a command
window. Of course, if you call any external programs, they probably *do*
create one, so don't do that.

Ben
 
P

PeteOlcott

If you use wperl.exe instead of perl.exe, you don't get a command
window. Of course, if you call any external programs, they probably *do*
create one, so don't do that.

Ben

None of these ideas seemed to work, but, I may have implemented them
incorrectly.
 
P

PeteOlcott

Create a batch file that runs the Perl script. Schedule the batch file
as a scheduled task.

CC

I tried this and it did not work. I also tried various combinations
of:
cmd /min
 
J

Joost Diepenmaat

PeteOlcott said:
I tried this and it did not work. I also tried various combinations
of:
cmd /min

How are you starting the program?

Here's what I just did:

rename the program using a new extension, for instance:

program.gpl

double click. then choose "select program", "browse..." (I'm guessing
these names, I've got a Dutch windows install) and choose
c:\perl\bin\wperl.exe

Done.
 
C

ccc31807

I tried this and it did not work. I also tried various combinations
of:
cmd /min

Write a 'hello world' program and save it like this:

#helloworld.plx
print "Hello, world\n";

Write a batch file and save it like this:
REM run_hello
perl helloworld.plx > hello.txt

(The part after the greater than sign redirects the output of the
helloworld program to a text file so you can see if it ran.)

In your Windows Explorer or My Computer screen you should see two
files, the plx file and the batch file. Double click on the batch file
and check to see if it wrote the output to hello.txt.

CC
 
P

PeteOlcott

How are you starting the program?

Here's what I just did:

rename the program using a new extension, for instance:

program.gpl

double click. then choose "select program", "browse..." (I'm guessing
these names, I've got a Dutch windows install) and choose
c:\perl\bin\wperl.exe

Done.

This worked. It still has a tiny little screen flash as soon as it
gets done executing, but, this is far less annoying than the console
window, popping up.
 

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,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top