Module to open port and receive data

2003-03-10 Thread Ricci, Mark
Hello All,


Is there a perl module that will open a specified port on a server
and receive data on it?


Thanks in advance,
Mark


This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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


RE: Module to open port and receive data

2003-03-10 Thread Ricci, Mark
Thanks, Simon.

In the lists opinion, how robust is IO::Socket?  Is it limited in what it
can do?  I'm looking to setup a client/server connection and pass large
amount of data thru in a short amount of time.

Thanks in advance,
Mark


-Original Message-
From: Simon Oliver [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 10, 2003 10:32 AM
To: Ricci, Mark
Cc: '[EMAIL PROTECTED]'
Subject: Re: Module to open port and receive data


Ricci, Mark wrote:
   Is there a perl module that will open a specified port on a server
  and receive data on it?

Socket, IO::Socket or Net::Telnet

-- 
   Simon Oliver



This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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


RE: Module to open port and receive data

2003-03-10 Thread Ricci, Mark
Does anybody have links to examples of IO::Socket?

All I have been able to find is the manpage.

Thanks in advance,
Mark

-Original Message-
From: Ricci, Mark 
Sent: Monday, March 10, 2003 10:40 AM
To: 'Simon Oliver'; Ricci, Mark
Cc: '[EMAIL PROTECTED]'
Subject: RE: Module to open port and receive data


Thanks, Simon.

In the lists opinion, how robust is IO::Socket?  Is it limited in what it
can do?  I'm looking to setup a client/server connection and pass large
amount of data thru in a short amount of time.

Thanks in advance,
Mark


-Original Message-
From: Simon Oliver [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 10, 2003 10:32 AM
To: Ricci, Mark
Cc: '[EMAIL PROTECTED]'
Subject: Re: Module to open port and receive data


Ricci, Mark wrote:
   Is there a perl module that will open a specified port on a server
  and receive data on it?

Socket, IO::Socket or Net::Telnet

-- 
   Simon Oliver



This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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


Web server live text question

2003-03-07 Thread Ricci, Mark
Hello All,

Does anybody know of a perl module(s) that could provide a solution
where a web server listens on a port (not 80) for an ASCII stream and then
would be able to write the text to an html file for viewing in real-time?
The page would add text by refreshing itself.
I'm looking at the feasibility of a solution.  It would run on a Win
2k Server.

Thanks in Advance,
Mark


This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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


List user account associated with Services

2003-02-10 Thread Ricci, Mark
Title: List user account associated with Services





Hello All,


 I need some advice in choosing a module(s) that would:
 1. Will run against a NT 4.0 server and report back a listing of all the services running on it and the user accounts that are associated with its startup. 

 2. Run this query against a remote server.


 Most likely a Roth module(s), but looking for advice from somebody that has tried something similar.



Thanks in advance,
Mark



This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited. If you are not the intended recipient, please contact the sender by reply and destroy all copies of the original message.

Thank you.


WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com






Temp tables perl DBI

2003-01-24 Thread Ricci, Mark
Title: Temp tables perl DBI





Hello,


 I have been assigned the task of pulling information from 10 different db's on the same server (MS SQL2000). I have enough experience with DBI to make the connection to one DB and storing it into an array but have never had to make multiple connections to different db's.

 My question is this: In creating a Store Procedure you can create a temp db to store the returned values of the queries, can this process be done with DBI? I will have to manipulate the data from all the db's to produce a single report. Is this possible? I haven't started to write code yet, I was looking to find proof that it is possible first.

Thanks in advance,
Mark



This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited. If you are not the intended recipient, please contact the sender by reply and destroy all copies of the original message.

Thank you.


WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com






RE: RE: Win32::AdminMisc module on linux

2002-12-26 Thread Ricci, Mark
Is coding around Samba an option?

-Original Message-
From: Dave Roth [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 3:39 AM
To: '[EMAIL PROTECTED]'; Dave Roth;
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: RE: Win32::AdminMisc module on linux


AdminMisc simply won't work on non Win32 systems.
I am not aware of any authentication modules that would do what you are
looking for. However years ago there was a groovy open source library that
did interact with an NT domain controller for the sake of authentication. I
had modified an old version of Linux's login to use this library. Basically
it allowed you to logon to the Linux box based on your Windows domain
credentials.  But this was way back in the early 1990's. I have no idea what
is in use today.

I suppose you could use LDAP and try authenticating against an Active
Directory server. Perl does have LDAP modules available.

Maybe someone better versed in authentication can give more details.

Good luck,
dave

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, December 25, 2002 11:31 PM
To: Dave Roth; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re:RE: Win32::AdminMisc module on linux


Hello Roth,

Actually my problem is that i wanna put up one website on intranet.In which
i wanna authenticate intranet's users to NT Domain Controller(PDC).Also i
wanna get rights of users on shared folders.And also wanna display those
files and folders web-based. I have tred ur Win32::AdminMisc module for
authentication to NT,but only on WIN32 platform. But my webserver is on
Linux-7.2.so,i cant install this module on Linux. Do you have any
alternatives for this?? Its very urgent to me.So,if possible give me some
solutions.I need it in perl only. Even there is some services which i can
run on my PDC and send request to that service for authentication.

Any suggestions are welcome.
Thanks in advance.


Kavita
On Wed, 25 Dec 2002 01:20:35 -0800 rothd wrote

It won't work on non Win32 systems. Actually it will only work on
NT/Win2k/XP/.NET (the NT core). I don't know if it will work under Win32
emulation (eg. WINE).

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 24, 2002 11:43 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Win32::AdminMisc module on linux


Hello All,

I wanna install Win32::AdminMisc module on linux RH-7.2.
Is this module work on linux to authenticate to NT domain controller.

Any suggestions will be accepted.

Thanks in advance.
Kavita


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


This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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



RE: Bounced Mail?

2002-11-18 Thread Ricci, Mark
Yes, I received about 10 of them this weekend.  It appears the persons
mailbox is full.

Mark

-Original Message-
From: Jack [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, November 16, 2002 2:07 AM
To: Perl-Win32-Users
Subject: Bounced Mail?


Is anyone else getting ReturnedMail from a : [EMAIL PROTECTED] -
These returns are cluttering up my inbox.
___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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



RE: Pattern matching

2002-11-15 Thread Ricci, Mark
-Original Message-
From: Nick Djurovich [mailto:nick_djurovich;aimtechnology.com] 
Sent: Thursday, November 14, 2002 5:17 PM
To: Ricci, Mark; [EMAIL PROTECTED]
Subject: RE: Pattern matching


Hi Mark,

Looking at the important part of the string ;

/search q=court reporting [...]

You could search for everything between 'q=' and '[...]' using a single
regexp as long as the format is the same for every line.

my ($eachLine, @lines);

foreach $eachLine (@lines)
{
my ($match) = ($eachLine =~ /q=([^\[]..\]*)/);

if ($match) { print $match\n; }

sleep 3;
}

Breaking down the search string ;

q=   look for q=
[^\[..\]]*   match all following characters that don't look like [...]

the () around the regexp means set $1 to the matching string

by using ($match), we are accepting $1 into the variable $match

I hope i explained that right.

Regards

Nick




Thanks Nick.  

I should have explained more clearly and given more example lines from the
file.

In the example line I have given above:
/search q=court reporting [...]   

The [...] is just random data.  It doesn't occur on every line.  I don't
have a consistent endpoint on each line to match.  I only have the q= to
match on.  
I just want to match whole words court reporting, e-transcript not the
other stuff on the line [...], hl=en lr= ie=UTF-8.

Thanks again for the help,
Mark


This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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



use LWP; -- problem with URL

2002-11-08 Thread Ricci, Mark
Title: use LWP;   -- problem with URL





Hello,


 I'm using LWP to access urls for the past twelve months, so I want to automate the script so that is it will hit months 1-12. The problem appears to be in the single quote (') that is encasing my url string. 

my $url=" 'http://mysite.com/refers$month02.html';


I get this error:


404 Not Found

The requested URL /refers$month02.html was not found on this server
This makes sense, since the single quotes will make the $month variable part of the string.


If I change the statement to:
my $url= "http://mysite.com/refers$month02.html;
Using double quotes. I get this error:


404 Not Found

The requested URL /refers.html was not found on this server
This doesn't make sense, since the double quotes should allow the variable $month to represent its current value. It's also taking out the 02. 

What am I missing. This shouldn't be difficult.
Thanks in advance,
Mark












This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited. If you are not the intended recipient, please contact the sender by reply and destroy all copies of the original message.

Thank you.


WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com






RE: Can't locate Date/Format.pm

2002-10-30 Thread Ricci, Mark
Title: Message



Thanks 
Ryan. 

I was 
able to find it on PPM after going to the CPAN site.

Mark

  
  -Original Message-From: FARRINGTON, RYAN 
  [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 30, 
  2002 12:15 PMTo: 'Ricci, Mark'; FARRINGTON, RYAN; 
  '[EMAIL PROTECTED]'Subject: RE: Can't 
  locate Date/Format.pm
  Mark,
   Here comes a stupid question. Did 
  you extract it? If so it created a directory named 'TimeDate-1.1301' under 
  that you'll see 2 directories and 4 files... you have 2 choices... you can 
  either type the following:
  
  perl 
  makefile.pl
  nmake
  nmake test
  nmake install
  
  I've 
  attached my version of nmake (you can find another if you don't trust me, also 
  I've renamed it to .txt from .exe) 
  
  or 
  you can just be brave and just copy the files from /lib to the following 
  locations
  
  %perl_path%\site\lib\Time\Zone.pm%perl_path%\site\lib\Date\Format.pm%perl_path%\site\lib\Date\Language.pm%perl_path%\site\lib\Date\Parse.pm%perl_path%\site\lib\Date\Language\Austrian.pm%perl_path%\site\lib\Date\Language\Czech.pm%perl_path%\site\lib\Date\Language\Dutch.pm%perl_path%\site\lib\Date\Language\English.pm%perl_path%\site\lib\Date\Language\French.pm%perl_path%\site\lib\Date\Language\German.pm%perl_path%\site\lib\Date\Language\Italian.pm%perl_path%\site\lib\Date\Language\Norwegian.pm
  
  
  or 
  you could always find it on PPM
  
  inside PPM type: 
  
  search TimeDate
  install TimeDate
  
  and 
  that will install a cut down version with only French as an alternate 
  language.
  
  
  
-Original Message-From: Ricci, Mark 
[mailto:[EMAIL PROTECTED]]Sent: Wednesday, October 30, 2002 
10:09 AMTo: 'FARRINGTON, RYAN'; 
'[EMAIL PROTECTED]'Subject: RE: Can't 
locate Date/Format.pm
Thanks, Ryan.

 I was able to download it. But what directory do 
you install it in. 
 I copied it here:
 c:\perl\site\lib\

 and here:
 c:\perl\site\win32

 but I'm getting the same error about not being able to 
find the pm.


Mark


  
  -Original Message-From: FARRINGTON, 
  RYAN [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 
  October 30, 2002 9:37 AMTo: 
  '[EMAIL PROTECTED]'Subject: RE: Can't 
  locate Date/Format.pm
  http://search.cpan.org/author/GBARR/TimeDate-1.1301/ 
  look at download 1/4 down the page... 
  -Original Message- From: 
  Ricci, Mark [mailto:[EMAIL PROTECTED]] 
  Sent: Wednesday, October 30, 2002 8:20 AM 
  To: '[EMAIL PROTECTED]' 
  Subject: Can't locate Date/Format.pm 
  Hello, 
   I can't seem to 
  find this module: 
   use 
  Date::Format; 
   Any pointers 
  where it might be located? 
  Thanks, Mark 
  This e-mail message is for the sole use of the intended 
  recipient(s) and may contain confidential and/or 
  privileged information. Any review, use, disclosure or distribution by persons or entities other than the 
  intended recipient(s) is prohibited. If you 
  are not the intended recipient, please contact the 
  sender by reply and destroy all copies of the original message. 
  Thank you. 
  WordWave, Capturing the Power of the Spoken Word 
  http://www.wordwave.com 
  ___ 
  Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 
  
This e-mail message is for the sole use of the 
intended recipient(s) and may contain confidential and/or privileged 
information. Any review, use, disclosure or distribution by persons or 
entities other than the intended recipient(s) is prohibited. If you are not 
the intended recipient, please contact the sender by reply and destroy all 
copies of the original message.
Thank you.
WordWave, Capturing the Power of the Spoken 
Word
http://www.wordwave.com



This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information.  Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited.  If you are not the intended recipient, please contact the sender by reply and destroy all copies of the original message.

Thank you.


WordWave, Capturing the Power of the Spoken Word

http://www.wordwave.com




RE: Desktop shortcut

2002-10-25 Thread Ricci, Mark
Thanks, James.

Will your script work on both Win98 and 2k systems?

I ended up using this script due to issues with 98:

use Win32::Shortcut;
use File::Copy;

if ($OS) {
$User = Win32::LoginName();
$Dir2k = c:\\documents and settings\\$User\\desktop;
print $Dir2k\n;
create2k;
} else {
$Dir98 = c:\\windows\\desktop;
print $Dir98\n;
create98;
}
 

sub create2k {
print Creating the link in 2k\n;
my $LINK=new Win32::Shortcut();
$LINK-Path($lldir\\$llexe);
$LINK-Arguments();
$LINK-WorkingDirectory($lldir);
$LINK-Description('Reports');
#$LINK-ShowCMD(SW_SHOWNORMAL);
$LINK-Save($Dir2k\\Reports.lnk);
}

sub create98 {
print Creating the link in 98\n;
my $LINK=new Win32::Shortcut();
$LINK-Path($lldir\\$llexe);
$LINK-Arguments();
$LINK-WorkingDirectory($lldir);
$LINK-Description('Reports');
#$LINK-ShowCMD(SW_SHOWNORMAL);
$LINK-Save($Dir98\\Reports.lnk);
}

#



Mark



-Original Message-
From: Krummel, James C - PGGC-6 [mailto:jckrummel;bpa.gov] 
Sent: Friday, October 25, 2002 2:47 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: Desktop shortcut



Mark,

Here is a way to make a shortcut to a file or URL using OLE.

James

use Win32::OLE;

$WSH = Win32::OLE-new('Wscript.Shell');

$SC =
$WSH-CreateShortcut($WSH-SpecialFolders('AllUsersDesktop').\\Sample.lnk)
;
$SC-{WindowStyle} = 4;  # 3=Maximized 4=Normal 7=Minimized 
$SC-{TargetPath} = %windir%\\notepad.exe;
$SC-{Hotkey} = ALT+CTRL+N;
$SC-Save;

-Original Message-
From: Ricci, Mark [mailto:mricci;wordwave.com]
Sent: Friday, October 25, 2002 8:05 AM
To: '[EMAIL PROTECTED]'
Subject: Desktop shortcut

Hello,

Is there a perl module that will automate creating a desktop shortcut?

Thanks,
Mark 


This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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



RE: Desktop shortcut

2002-10-25 Thread Ricci, Mark
Thanks for the info, James.  I might be able to enhance my script even
further with your pointers.


Mark

-Original Message-
From: Krummel, James C - PGGC-6 [mailto:jckrummel;bpa.gov] 
Sent: Friday, October 25, 2002 4:02 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: Desktop shortcut



Mark,

It should work properly on a Win9x machine, as I asked the OS for the
location of the desktop rather then using a hardcoded path, although I do
not know if it supports the All Users Desktop tag.  Here is a list of most
of the standard folders the OS tracks on.  Win9x does not support them all,
but Win2k does.

James

use Win32::OLE;

$WSH = Win32::OLE-new('Wscript.Shell');

print $ENV{WINDIR}.\n;
print $ENV{SYSTEMROOT}.\n;
print $WSH-SpecialFolders('AllUsersDesktop').\n;
print $WSH-SpecialFolders('AllUsersStartMenu').\n;
print $WSH-SpecialFolders('AllUsersPrograms').\n;
print $WSH-SpecialFolders('AllUsersStartup').\n;
print $WSH-SpecialFolders('Desktop').\n;
print $WSH-SpecialFolders('Favorites').\n;
print $WSH-SpecialFolders('Fonts').\n;
print $WSH-SpecialFolders('MyDocuments').\n;
print $WSH-SpecialFolders('NetHood').\n;
print $WSH-SpecialFolders('PrintHood').\n;
print $WSH-SpecialFolders('Programs').\n;
print $WSH-SpecialFolders('Recent').\n;
print $WSH-SpecialFolders('SendTo').\n;
print $WSH-SpecialFolders('StartMenu').\n;
print $WSH-SpecialFolders('Startup').\n;
print $WSH-SpecialFolders('Templates').\n;

-Original Message-
From: Ricci, Mark [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' 
[EMAIL PROTECTED]
Subject: RE: Desktop shortcut
Date: Fri, 25 Oct 2002 14:53:05 -0400

Thanks, James.

   Will your script work on both Win98 and 2k systems?

I ended up using this script due to issues with 98:

use Win32::Shortcut;
use File::Copy;

if ($OS) {
$User = Win32::LoginName();
$Dir2k = c:\\documents and settings\\$User\\desktop;
print $Dir2k\n;
create2k;
} else {
$Dir98 = c:\\windows\\desktop;
print $Dir98\n;
create98;
}
 

sub create2k {
print Creating the link in 2k\n;
my $LINK=new Win32::Shortcut();
$LINK-Path($lldir\\$llexe);
$LINK-Arguments();
$LINK-WorkingDirectory($lldir); $LINK-Description('Reports');
#$LINK-ShowCMD(SW_SHOWNORMAL);
$LINK-Save($Dir2k\\Reports.lnk);
}

sub create98 {
print Creating the link in 98\n;
my $LINK=new Win32::Shortcut();
$LINK-Path($lldir\\$llexe);
$LINK-Arguments();
$LINK-WorkingDirectory($lldir); $LINK-Description('Reports');
#$LINK-ShowCMD(SW_SHOWNORMAL);
$LINK-Save($Dir98\\Reports.lnk);
}

#



Mark



-Original Message-
From: Krummel, James C - PGGC-6 [mailto:jckrummel;bpa.gov]
Sent: Friday, October 25, 2002 2:47 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: Desktop shortcut



Mark,

Here is a way to make a shortcut to a file or URL using OLE.

James

use Win32::OLE;

$WSH = Win32::OLE-new('Wscript.Shell');

$SC =
$WSH-CreateShortcut($WSH-SpecialFolders('AllUsersDesktop').\\Sample.
lnk)
;
$SC-{WindowStyle} = 4;  # 3=Maximized 4=Normal 7=Minimized 
$SC-{TargetPath} = %windir%\\notepad.exe;
$SC-{Hotkey} = ALT+CTRL+N;
$SC-Save;

-Original Message-
From: Ricci, Mark [mailto:mricci;wordwave.com]
Sent: Friday, October 25, 2002 8:05 AM
To: '[EMAIL PROTECTED]'
Subject: Desktop shortcut

Hello,

Is there a perl module that will automate creating a desktop shortcut?

Thanks,
Mark





This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word
http://www.wordwave.com


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



PerlSVC

2002-09-06 Thread Ricci, Mark

Hello All,

I'm having some trouble getting this script to run as a service, any
and all help is appreciated:

#!c:\perl\bin
use Win32::Process;
use Win32;

package PerlSvc;

our $Name = 'CDcontrol';
ofur $DisplayName = 'CDcontrol Service';
$dir = ;
$file = ;
$pid = ;
$c = 1;
$eproc = 0;
$dproc = 0;

sub Startup {
# here's where your startup code will go
  main::Init();
  while(ContinueRun()) {
main::LogIt(localtime().\n) unless (time() % 30);
sleep(1);
  } # end while loop
} # end startup sub

sub install {
use Win32::TieRegistry(Delimiter=/, ArrayValues=0);

$Registry-Delimiter(/);
$svcKey =
$Registry-{LMachine/System/CurrentControlSet/Services/};
$thisKey = $svcKey-{CDcontrol/};

$thisKey-{/Start} = [0x0002,REG_DWORD];
} # end of Install subroutine

package main;

sub Init {

sub ErrorReport {
print Win32::FormatMessage( Win32::GetLastError() );
} # end sub Error report

while (1) {
## Look at contents of the cdrom drives D and E
for $drives(d,e) {
$dir = $drives:;
print this is dir $dir\n;
opendir (CDROM1, $dir) || ErrorReport;
while (defined($file = readdir(CDROM1))) {
if ($file =~ /mpg/) {
print This is directory $dir and this is the file $file in
first section\n;
$vals{$dir} = $file;
sleep(2);
$c++;
} else { 
print This file is not a mpg $file\n; 
$eject = `c:\\eject\\eject.exe $dir`;
sleep(2);
} # end else statement
} # end while loop
closedir(CDROM1);
} # end for loop


while ( ($dir, $file) = each(%vals) ) {
print $dir\n;
if ($dir eq d:) {
$dproc = 1;
$ddir = $dir;
$dfile = $file;
} elsif ($dir eqe:) {
$eproc = 1;
$edir = $dir;
$efile = $file;
}
print This is directory $dir and this is the file $file in
first sub\n;

}  # end while loop
print Dproc is $dproc and Eproc is $eproc\n;
  Start the WMP for the D: Drive
if ($dproc  0) {
Win32::Process::Create($dprocess, 
c:\\Program Files\\Windows Media
Player\\mplayer2.exe,
mplayer2.exe /open $ddir/$dfile,
0,
NORMAL_PRIORITY_CLASS,
.) || die ErrorReport();
$dpid =$dprocess-GetProcessID();
$dprocess-GetExitCode($xid);
$dpids{$ddir} = $dpid;
sleep(4);
}
  Start the WMP for the E: Drive
if ($eproc  0) {
Win32::Process::Create($eprocess, 
c:\\Program Files\\Windows Media
Player\\mplayer2.exe,
mplayer2.exe /open $edir/$efile,
0,
NORMAL_PRIORITY_CLASS,
.) || die ErrorReport();
$epid =$eprocess-GetProcessID();
$eprocess-GetExitCode($xid);
$epids{$edir} = $epid;
sleep(4);
}
  Debug print statements
print This is dproc $dproc before if statement\n;
print This is eproc $eproc before if statement\n;


# Conditionals to wait for the WMP 
#  process to end and eject the CDROM
if ($dproc) {
print This is dproc $dproc\n;
$dprocess-Wait(INFINITE);  
sleep(4);
print should be ejecting $ddir\n;
$eject = `c:\\eject\\eject.exe $ddir`;
$dproc = 0;
delete($vals{$ddir}); 
sleep(4);
}
if ($eproc) {
print This is eproc $eproc\n;
$eprocess-Wait(INFINITE);
sleep(4);
print should be ejecting $edir\n;
$eject = `c:\\eject\\eject.exe $edir`;
$eproc = 0;
delete($vals{$edir}); 
sleep(4);
}

} # end of the c loop
} # end of the INIT Sub



This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and/or privileged information.  Any review, use,
disclosure or distribution by persons or entities other than the intended
recipient(s) is prohibited.  If you are not the intended recipient, please
contact the sender by reply and destroy all copies of the original message.
Thank you.

WordWave, Capturing the Power of the Spoken Word