Windows shortcut without dos prompt

B

bxb7668

I need to start a perl script from a Windows Start Menu shortcut. The
perl script uses TK to display the user interface. I know that I've
seen a way to create the shortcut so that a DOS window does not open
and hang around until my script ends but searching I cannot find it.
I've tried creating a bat script wrapper for my Perl script but that
wasn't the answer. Can anyone provide a pointer in the right
direction? Thanks.

Brian
 
B

Bob Walton

bxb7668 said:
I need to start a perl script from a Windows Start Menu shortcut. The
perl script uses TK to display the user interface. I know that I've
seen a way to create the shortcut so that a DOS window does not open
and hang around until my script ends but searching I cannot find it.
I've tried creating a bat script wrapper for my Perl script but that
wasn't the answer. Can anyone provide a pointer in the right
direction? Thanks.

Brian

Assuming you're using ActiveState Perl, check out:

wperl

instead of the

perl

command. It does the same thing, but with no ugly black window.
Note that STDOUT goes to the bit bucket by default. It's just
the ticket for Tk.
 
B

bxb7668

Thanks for the suggestion. Yes I'm using ActiveState Perl 5.6.1. I
tried wperl and it popped up two black windows instead on one, but they
both closed immediately. I've created a shortcut in the Start menu.
Its target is:

C:\Perl\bin\wperl.exe O:\prod\vobtools\bin\bvbfmerge.pl -w

When I select the shortcut I get one black window that appears and
disappears quickly. Then another opens and disappears followed by my
scripts Tk window. Ideally I'd prefer to skip the two popups, but this
is getting much closer.

Thanks again.
Brian
 
B

Bob Walton

bxb7668 said:
Thanks for the suggestion. Yes I'm using ActiveState Perl 5.6.1. I
tried wperl and it popped up two black windows instead on one, but they
both closed immediately. I've created a shortcut in the Start menu.
Its target is:

C:\Perl\bin\wperl.exe O:\prod\vobtools\bin\bvbfmerge.pl -w

When I select the shortcut I get one black window that appears and
disappears quickly. Then another opens and disappears followed by my
scripts Tk window. Ideally I'd prefer to skip the two popups, but this
is getting much closer.

Hmmmmm...that's not the behavior on my system. On mine, I get
nothing but the Tk window. My system is Windoze XP Home SP2 with
all current updates:

D:\junk>ver

Microsoft Windows XP [Version 5.1.2600]

D:\junk>perl -v

This is perl, v5.8.6 built for MSWin32-x86-multi-thread
(with 3 registered patches, see perl -V for more detail)

Copyright 1987-2004, Larry Wall

Binary build 811 provided by ActiveState Corp.
http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Dec 13 2004 09:52:01

....
 
K

Klaus

Thanks for the suggestion. Yes I'm using ActiveState Perl 5.6.1.

Please quote an appropriate amount of context in your reply, so that others
can follow.

[ I have copied your original question... ]

-- I need to start a perl script from a Windows Start Menu shortcut. The
-- perl script uses TK to display the user interface. I know that I've
-- seen a way to create the shortcut so that a DOS window does not open
-- and hang around until my script ends but searching I cannot find it.
-- I've tried creating a bat script wrapper for my Perl script but that
-- wasn't the answer. Can anyone provide a pointer in the right
-- direction? Thanks.

[ ... and some context from Bob Walton's reply ]

++ Assuming you're using ActiveState Perl, check out: wperl instead of
++ the perl command.


[ back to your latest post ]

[...]
C:\Perl\bin\wperl.exe O:\prod\vobtools\bin\bvbfmerge.pl -w

When I select the shortcut I get one black window that appears and
disappears quickly. Then another opens and disappears followed by my
scripts Tk window. Ideally I'd prefer to skip the two popups, but this
is getting much closer.

Your comment "...this is getting much closer..." suggests to me that, by
using 'wperl.exe' instead of 'perl.exe', the number of "black popup-windows"
has been reduced. This is a good sign and (hopefully) a step in the right
direction.

The next step would be to create a simple "hello world" program that uses
Tk:

hello.pl
=====================
use strict;
use warnings;
use Tk;
my $main = new MainWindow;
$main->Label(-text => 'Hello World!')->pack;
MainLoop;
=====================

....and to call it using wperl.exe.

If you get any "black popup-windows" by running "wperl.exe hello.pl", then
this suggests a problem with your installation of Perl.

If you don't get any "black popup-windows" by running "wperl.exe hello.pl",
then this suggests that the two "black popup-windows" from your previous run
"wperl.exe O:\prod\vobtools\bin\bvbfmerge.pl" have been a consequence of
some actions inside "bvbfmerge.pl".

I hope this helps.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top