Re: How to launch an application through telnet

2005-10-25 Thread Bob Davis

If you find the service that is running the telnet session there is an option "Allow 
service to interact with desktop".

Chris wrote:

Ted Zeng wrote:


The app. Get launched, but No GUI appear. I can only see it in the 
task manager. Is there anything I can do to launch an application 
through telnet.



How about using Remote Desktop Connection? There are clients for both
Windows and *nix.

- Chris

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

.



--
Bob Davis | Senior Advisory Software Developer - Applications
[EMAIL PROTECTED]
Work: 603-926-9696 x3456
Home: 603-778-0781
Aim: dad1732
Yim: rsdavis9
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: outlook address book

2005-10-19 Thread Bob Davis

This is a work in progress. I havent finished all I want to do with it yet.

Todo:
1. Speed up search by using addrfiler object
2. Make addr single line address display with tele, st addr, city, country
3. Find the correct addrlist without having to use a index to it. (the -n arg)

To use it you will have to put your own password in the login() method.
If you have changed the default profile name you will have to change the 
profile name.

I use something like this.
perl -S exchaddr.pl -n 8 [-f] -s davis

The 8 is the 8th addrlist which at my installation is the shortest.

bob



Chris Wagner wrote:

Greets, does anyone know of a module or WMI/OLE method that will let u
interact with the Outlook global address list?  Or an offline copy thereof?
I want to be able to search fields for usernames and bring back all the info.







--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

.



--
Bob Davis | Senior Advisory Software Developer - Applications
[EMAIL PROTECTED]
Work: 603-926-9696 x3456
Home: 603-778-0781
Aim: dad1732
Yim: rsdavis9
#!/usr/bin/perl
use strict;
use Win32::OLE; 
use Data::Dumper;
my $Session;

my $Recurs = 0;
my $Pattern = '.*';
my $AddrListNum;
my $Full = 0;

while (my $opt=shift @ARGV) {
if ($opt =~ /^-r/i) { 
$Recurs = 1;
}
if ($opt =~ /^-s/i) { 
$Pattern = shift @ARGV; 
}
if ($opt =~ /^-n/i) { 
$AddrListNum = shift @ARGV; 
}
if ($opt =~ /^-f/i) { 
$Full = 1;
}
if ($opt !~ /^-/i) { unshift @ARGV, $opt; last; }
}
print "aln:pat:recur=$AddrListNum:$Pattern:$Recurs\n";

my $name = "Microsoft Outlook Internet Settings";

Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE) ;
die "Coinitialize error", Win32::OLE->LastError(),"\n" if 
Win32::OLE->LastError();

$Session = Win32::OLE->new('MAPI.Session');
die "Could not create a MAPI Session: $!", Win32::OLE->LastError(),"\n" if 
Win32::OLE->LastError();
$Session->Logon($name, "xx");
die "Could not login: ", Win32::OLE->LastError(),"\n" if 
Win32::OLE->LastError(); 

my $AddrLists = $Session->{AddressLists};
print "AddrLists=$AddrLists\n";

if ($AddrListNum) {
my $AddrList = $AddrLists->Item(0+$AddrListNum);
$Recurs = 1;
DspAddrList($AddrList, $AddrListNum);
} else {
for (my $i=1; $i<=$$AddrLists{Count}; $i++) {
my $AddrList = $AddrLists->Item($i);
DspAddrList($AddrList, $i);
}
}


sub DspAddrList {
my ($AddrList, $Cnt) = @_;
my $id = sprintf "%08x", $$AddrList{ID};
my $Name = $$AddrList{Name};
my $AddrEntrys = $$AddrList{AddressEntries};
print "\tAddrList$Cnt:ID:AddrEntries=$id:$Name:$$AddrEntrys{Count}\n";
if ($Recurs) {
for (my $i=1; $i<=$$AddrEntrys{Count}; $i++) {
my $AddrEntry = $AddrEntrys->Item($i);
my $Name=$$AddrEntry{Name};
my $Type=$$AddrEntry{Type};
my $ID=$$AddrEntry{ID};
my $Address=$$AddrEntry{Address};
my $SmtpAddr;
#if ($Stmt =~ /(?is)$rx/) {
if ($Name =~ /(?is)$Pattern/) {
$SmtpAddr = GetPropVal($AddrEntry, 0x39fe001e);
print 
"\t\tName:Index:Type:SmtpAddr=$Name:$i:$Type::$SmtpAddr\n";
print "\t\t\tAddress=$Address\n";
#print "\t\t\tID=$ID\n";
if ($Full) {
my $Aef = $$AddrEntry{Fields};
for (my $i=1; $i<$$Aef{Count}; $i++) {
my $Prop=$Aef->Item($i);
my $Name=$$Prop{Name};
my $id = sprintf "%08x", 
$$Prop{ID};
my $Value=$$Prop{Value};
print 
"\t\t\t$i:ID:Value=$id:$Value\n";
# either method works 
#   universal would work if 
array was any where in tree
#   ref works only if array 

Re: outlook address book

2005-10-19 Thread Bob Davis

This is a work in progress. I havent finished all I want to do with it yet.

Todo:
1. Speed up search by using addrfiler object
2. Make addr single line address display with tele, st addr, city, country
3. Find the correct addrlist without having to use a index to it. (the -n arg)

To use it you will have to put your own password in the login() method.
If you have changed the default profile name you will have to change the 
profile name.

I use something like this.
perl -S exchaddr.pl -n 8 [-f] -s davis

The 8 is the 8th addrlist which at my installation is the shortest.

bob

Chris Wagner wrote:

Greets, does anyone know of a module or WMI/OLE method that will let u
interact with the Outlook global address list?  Or an offline copy thereof?
I want to be able to search fields for usernames and bring back all the info.







--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

.



--
Bob Davis | Senior Advisory Software Developer - Applications
[EMAIL PROTECTED]
Work: 603-926-9696 x3456
Home: 603-778-0781
Aim: dad1732
Yim: rsdavis9
#!/usr/bin/perl
use strict;
use Win32::OLE; 
use Data::Dumper;
my $Session;

my $Recurs = 0;
my $Pattern = '.*';
my $AddrListNum;
my $Full = 0;

while (my $opt=shift @ARGV) {
if ($opt =~ /^-r/i) { 
$Recurs = 1;
}
if ($opt =~ /^-s/i) { 
$Pattern = shift @ARGV; 
}
if ($opt =~ /^-n/i) { 
$AddrListNum = shift @ARGV; 
}
if ($opt =~ /^-f/i) { 
$Full = 1;
}
if ($opt !~ /^-/i) { unshift @ARGV, $opt; last; }
}
print "aln:pat:recur=$AddrListNum:$Pattern:$Recurs\n";

my $name = "Microsoft Outlook Internet Settings";

Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE) ;
die "Coinitialize error", Win32::OLE->LastError(),"\n" if 
Win32::OLE->LastError();

$Session = Win32::OLE->new('MAPI.Session');
die "Could not create a MAPI Session: $!", Win32::OLE->LastError(),"\n" if 
Win32::OLE->LastError();
$Session->Logon($name, "xx");
die "Could not login: ", Win32::OLE->LastError(),"\n" if 
Win32::OLE->LastError(); 

my $AddrLists = $Session->{AddressLists};
print "AddrLists=$AddrLists\n";

if ($AddrListNum) {
my $AddrList = $AddrLists->Item(0+$AddrListNum);
$Recurs = 1;
DspAddrList($AddrList, $AddrListNum);
} else {
for (my $i=1; $i<=$$AddrLists{Count}; $i++) {
my $AddrList = $AddrLists->Item($i);
DspAddrList($AddrList, $i);
}
}


sub DspAddrList {
my ($AddrList, $Cnt) = @_;
my $id = sprintf "%08x", $$AddrList{ID};
my $Name = $$AddrList{Name};
my $AddrEntrys = $$AddrList{AddressEntries};
print "\tAddrList$Cnt:ID:AddrEntries=$id:$Name:$$AddrEntrys{Count}\n";
if ($Recurs) {
for (my $i=1; $i<=$$AddrEntrys{Count}; $i++) {
my $AddrEntry = $AddrEntrys->Item($i);
my $Name=$$AddrEntry{Name};
my $Type=$$AddrEntry{Type};
my $ID=$$AddrEntry{ID};
my $Address=$$AddrEntry{Address};
my $SmtpAddr;
#if ($Stmt =~ /(?is)$rx/) {
if ($Name =~ /(?is)$Pattern/) {
$SmtpAddr = GetPropVal($AddrEntry, 0x39fe001e);
print 
"\t\tName:Index:Type:SmtpAddr=$Name:$i:$Type::$SmtpAddr\n";
print "\t\t\tAddress=$Address\n";
#print "\t\t\tID=$ID\n";
if ($Full) {
my $Aef = $$AddrEntry{Fields};
for (my $i=1; $i<$$Aef{Count}; $i++) {
my $Prop=$Aef->Item($i);
my $Name=$$Prop{Name};
my $id = sprintf "%08x", 
$$Prop{ID};
my $Value=$$Prop{Value};
print 
"\t\t\t$i:ID:Value=$id:$Value\n";
# either method works 
#   universal would work if 
array was any where in tree
#   ref works only if array 

Re: send a UDP paket without a session

2005-10-11 Thread Bob Davis

Markus wrote:

Hi all,

 


have someone a idea how to generate UPD packets and send out on a Ethernet
adapter without a established session.

I need this to generate RIP routes generation.

The default destination definition are:

* source IP equal the own IP interface, 


* destination IP 224.0.0.9,

UDP port 520 in source and destination.

 


Thanks in advance

 


markus



Here is an example from the perl cookbook

#!/usr/bin/perl -w
# udpmsg - send a message to the udpquotd server

use IO::Socket;
use strict;

my($sock, $server_host, $msg, $port, $ipaddr, $hishost,
   $MAXLEN, $PORTNO, $TIMEOUT);

$MAXLEN  = 1024;
$PORTNO  = 5151;
$TIMEOUT = 5;

$server_host = shift;
$msg = "@ARGV";
$sock = IO::Socket::INET->new(Proto => 'udp',
  PeerPort  => $PORTNO,
  PeerAddr  => $server_host)
or die "Creating socket: $!\n";
$sock->send($msg) or die "send: $!";

eval {
local $SIG{ALRM} = sub { die "alarm time out" };
alarm $TIMEOUT;
$sock->recv($msg, $MAXLEN)  or die "recv: $!";
alarm 0;
1;  # return value from eval on normalcy
} or die "recv from $server_host timed out after $TIMEOUT seconds.\n";

($port, $ipaddr) = sockaddr_in($sock->peername);
$hishost = gethostbyaddr($ipaddr, AF_INET);
print "Server $hishost responded ``$msg''\n";

--
Bob Davis | Senior Advisory Software Developer - Applications
[EMAIL PROTECTED]
Work: 603-926-9696 x3456
Home: 603-778-0781
Aim: dad1732
Yim: rsdavis9
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: cdo win32-ole "object model guard"

2005-04-23 Thread Bob Davis
Chris Cappelletti wrote:
I have a perl program that sends email via win32-ole cdo.
I started having the 2 dialogs since "upgrading" :-( to outlook 2003.
The dialogs read:
   


Here's the situation.  If I remember correctly (and I probably don't)
there are three normal ways to use MAPI to send email. 

1.  Outlook object Model
2.  Some way that I forget (this is the CDO method [I think])
 

Yes this is cdo or automation which is accessable from Win32::OLE
3.  MAPI
 

Yes the mapilogonex func in the mapi api takes a mapi_extended flag 
which seems to prevent the dialogs.

Option 1 and 2 are now officially locked with 2003.  They are
unfortunately the only way you can access MAPI email from scripting
languages (that I know of).  Option 3, well I hope you're a good C
programmer.  

My solution:  I paid $195 (or something like that) for a dll file called
Redemption.  I can look up more info if you can't find it with a google
search.  Some guy (who really knows MAPI) wrote it and he gets around
all the security that 2003 uses.  I'm pretty sure that it supports
IDispatch so you can use Win32::OLE to access it.
 

I installed it and havent figured out how to adapt my perl program to 
use it yet.

There is also a "click" solution. Basically it is a program that runs in 
the background and clicks the dialogs for you. It happens so fast you 
dont even see the dialogs popup.

Another solution I havent tried yet:
If I can write a C program to access the email with extended mapi 
shouldnt I be able to use perl win32api to call any C api?

bob
Hope that helps.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: cdo win32-ole "object model guard"

2005-04-23 Thread Bob Davis
Ken Cornetet wrote:
Two ways come to mind:
1. Use Net::SMTP to send the email.
2. Since you are using Exchange, you can create a special public folder
"Outlook Security Settings" with a special item in it that controls
Outlook security. You'll have to see the Outlook docs for more info.
 

Its my understanding that this "folder" is only setup on the exchange 
server by a exchange admin?
I dont have any control over the exchange server. But thanks anyways.
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


cdo win32-ole "object model guard"

2005-04-19 Thread Bob Davis
Hi
I have a perl program that sends email via win32-ole cdo.
I started having the 2 dialogs since "upgrading" :-( to outlook 2003.
The dialogs read:
1. A program is trying to access e-mail addresses you have stored in 
Outlook. Do you want to allow this?
2. A program is trying to automatically send e-mail on your behalf. Do 
you want to allow this?

The last one with the 5 second delay. I have read that this is called 
"object model guard" and there is no registry setting to turn it off. 
Since this is a work computer I can not uninstall outlook 2003. I have 
also read that extended mapi can prevent this error. I have a C++ 
program that uses extended mapi to get the addresses of names and this 
doesnt trigger the dialogs.

So I want to change my perl code so it doesnt ask for the 2 dialogs. 
Anybody have any suggestions?

Here is the code which basically listens for smtp connections and 
forwards the email to exchange. I have snipped the smtp portion to keep 
it brief. If anybody wants the ocde I can include the whole program.

use Win32::OLE;
use Net::SMTP::Server;
use Net::SMTP::Server::Client2;
my $name = "Microsoft Outlook Internet Settings";
Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE) ;
die "Coinitialize error", Win32::OLE->LastError(),"\n" if 
Win32::OLE->LastError();

$Session = Win32::OLE->new('MAPI.Session');
die "Could not create a MAPI Session: $!", Win32::OLE->LastError(),"\n" 
if Win32::OLE->LastError();
$Session->Logon($name, "");
die "Could not login: ", Win32::OLE->LastError(),"\n" if 
Win32::OLE->LastError();

my $message = $Session->Outbox->Messages->Add($Subject, $Body);
for my $recp (@{$client->{TO}}) {
  my $recipient = $message->Recipients->Add;
  $recipient->{Name} = $recp;
  $recipient->{Type} = 1; # 1 = "To:", 2 = "Cc:", 3 = "Bcc:"
  $recipient->Resolve();
}
$message->Send(1, 0, 0);
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


C and Tk

2002-07-02 Thread Bob Davis

Hi

Pardon if this seems offtopic.

I want to use Tk as a C cross patform library.

1. Is this a good way to develope in C/C++ a cross platform GUI
2. I have compiled perl/tk and tcl/tk from the source and I look at the 
resultant dll's
a. perl (tk.dll and subordinate dlls in the blib dir structure)
b. tcl (tk84.dll)
The perl dll's only so boot_tk. The tcl dll's so what looks like a 
complete function set. Is tcl a better entry point into using C and tk 
w/o any embedded script engines?


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: perldoc in tk window?

2002-05-16 Thread Bob Davis

It looks like tkpod does what I want.

Use ppm and
install tk-pod

Bob Davis wrote:

> Is there a command to have perldoc command display in a text window? 
> An option off of "perldoc -tk".
>
> bob
>
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



perldoc in tk window?

2002-05-16 Thread Bob Davis

Is there a command to have perldoc command display in a text window? An 
option off of "perldoc -tk".

bob

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: tk html help missing

2002-04-18 Thread Bob Davis

I must REALLY be missing something obvious.

I  cant find the chm doc anywhere under my c:/perl installation.
I have 5.6.1 build 628

bob

Thomas R Wyant_III wrote:

>"Tillman, James" <[EMAIL PROTECTED]> wrote:
>
>>Is anyone else less than thrilled regarding this new CHM version of
>>the help?  I fail to see the benefit when it doesn't add newly
>>installed modules to the help.  With the plain HTML help we used to
>>have in ActivePerl, new modules got added to the tree automagically.
>>
>
>IM(NS)HO it's not a total washout, but CHM has definite drawbacks. I have
>both, having rooted out and installed the HTML help kit (which ActiveState
>did NOT make easy to find). When I'm looking for module documentation, and
>I know the module is in the core ActivePerl kit, I use CHM. For anything
>else I typically use HTML. I can search an individual page, I can add
>modules and get the docs, I can open in a separate window when the docs are
>complex enough that I need to fill a screen with them, and I can search a
>doc and have the hit actually displayed (instead of having to scroll down
>looking for highlighted words). There's no built-in search of the entire
>document tree, but there are other ways to do that.
>
>>Maybe I'm missing something obvious.
>>
>
>Me too. We do get a full-docset search with the CHM version, but "full" in
>this case means ActivePerl distribution only (i.e. for sufficiently small
>values of "full.")
>
>I hesitate to complain too much about free software, but I feel that
>ActiveState has pulled several unsmooth moves lately. I'm at 630, and I
>plan to hunker down and stay that way at least until they work out the PPM
>problems. I'm not ready to call for dumping the CHM documentation, but I
>believe it would be good to include the HTML documentation in the core
>distribution, at least until they figure out how to add the docs for new
>modules to CHM.
>
>Tom Wyant
>
>___
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: tk html help missing

2002-04-17 Thread Bob Davis

Thanks

Worked great.

bob

Adam Frielink wrote:

>A while back on the list, someone posted the following program which updates
>the html tree in the older doc (before the .chm was used).
>
>
>
>
>>-Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED]]On Behalf Of
>>Toby Stuart
>>Sent: Tuesday, April 16, 2002 7:21 PM
>>To: 'Bob Davis'
>>Cc: '[EMAIL PROTECTED]'
>>Subject: RE: tk html help missing
>>
>>
>>don't know why it's not there anymore but you can use pod2html
>>(batch file)
>>to convert:
>>
>>  pod2html --infile=file.pod --outfile=file.html
>>
>>you could easily create a batch file to do 'em all in one hit.
>>
>>hth
>>
>>toby
>>
>>-Original Message-
>>From: Bob Davis [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, April 17, 2002 6:35 AM
>>To: Perl-Win32-Users Mailing List
>>Subject: tk html help missing
>>
>>
>>I upgraded from Tk::VERSION
>>800.022
>>to
>>800.023
>>
>>And the html help for tk disappeared.
>>Is there a package to down load to get it back?
>>Is there a command to convert the pod documentation to html help?
>>Or is it just plain missing in the new version.
>>
>>thanks
>>bob
>>
>>
>>
>>___
>>Perl-Win32-Users mailing list
>>[EMAIL PROTECTED]
>>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>>___
>>Perl-Win32-Users mailing list
>>[EMAIL PROTECTED]
>>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>>
>


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs