Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Windows shortcut without dos prompt

Reply
Thread Tools

Windows shortcut without dos prompt

 
 
bxb7668
Guest
Posts: n/a
 
      08-03-2005
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

 
Reply With Quote
 
 
 
 
Bob Walton
Guest
Posts: n/a
 
      08-03-2005
bxb7668 wrote:

> 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.

--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
 
Reply With Quote
 
 
 
 
bxb7668
Guest
Posts: n/a
 
      08-04-2005
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

 
Reply With Quote
 
Bob Walton
Guest
Posts: n/a
 
      08-05-2005
bxb7668 wrote:

> 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

....
> Brian
>



--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
 
Reply With Quote
 
Klaus
Guest
Posts: n/a
 
      08-08-2005
"bxb7668" <> wrote in message
news: oups.com...

> 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.

--
Klaus




 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine Windows version from a DOS prompt? Sophia Computer Support 13 08-03-2011 04:24 PM
How to open a shell prompt from an existing shell prompt gaurav kashyap Python 2 10-30-2008 09:18 AM
Shortcut, And Re-Directing Of Shortcut Quest. ? Robert11 Computer Support 1 12-30-2004 03:13 PM
Cannot use dos prompt in windows Gaz Computer Support 4 11-08-2003 03:19 PM
Dos prompt in Windows 98 WW Computer Support 7 10-17-2003 02:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57