RE: perl to web-scrape an html page that requires 'Javascript' to fully render

2013-02-15 Thread Ken Cornetet
Use OLE to drive IE and scrape the results. Here's a snippet of code that I used years ago to check warrantee expiration on a list of HP servers. The HP web page used javascript and redirections before finally ending up on the page with the data. my $parms = 'country=US' .

RE: Win32::LookupAccountSID()

2012-07-10 Thread Ken Cornetet
http://code.activestate.com/lists/perl-win32-users/26301/ -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry Brevik Sent: Tuesday, July 10, 2012 2:28 PM To: perl Win32-users Subject:

RE: naive LWP::Get question (perhaps JavaScript related?)

2012-06-08 Thread Ken Cornetet
If you are on windows, you can drive IE via OLE, and screen-scrape the results. Here's a bit of code I used some time ago (way back when we had physical servers) to get the warrantee information from an HP web site. sub GetWarranty { my $serial = shift; my

RE: Win32::GUI, minimize, and window resize

2011-12-16 Thread Ken Cornetet
For future googlers, the answer to the problem is get rid of the $mw-Show() call in the resize routine. Ken Cornetet 812.482.8499 To err is human - to moo, bovine. From: Ken Cornetet Sent: Thursday, December 15, 2011 10:02 AM To: perl-win32-users@listserv.activestate.com Subject: Win32::GUI

Win32::GUI, minimize, and window resize

2011-12-15 Thread Ken Cornetet
, $mw-ScaleHeight - $sb-Height); $sb-Resize($mw-ScaleWidth, $sb-Height); $lv-Resize($mw-ScaleWidth, $mw-ScaleHeight - $sb-Height - $menu-Height); $mw-Show; return 1; } Ken Cornetet 812.482.8499 To err is human - to moo, bovine

RE: How to push a hash on to a hash of array entries

2011-11-08 Thread Ken Cornetet
I usually find that when I start getting data structures so complicated that I have to think about it, it is time to move to objects. Using objects usually makes the complicated data structures go away. Ken Cornetet 812.482.8499 To err is human - to moo, bovine. -Original Message- From

Win32::GUI, WMI, and threads

2011-10-27 Thread Ken Cornetet
? Or, is there any way to do async WMI calls? Ken Cornetet 812.482.8499 To err is human - to moo, bovine. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Help with Array of Arrays

2011-03-07 Thread Ken Cornetet
} = shift; $self{z} = shift; $self{partno} = shift; $self{$description} = shift; bless ($self, $class); return $self; } 1; Ken Cornetet 812.482.8499 To err is human - to moo, bovine. -Original Message- From: perl-win32-users-boun

RE: Printing on Win32

2009-12-16 Thread Ken Cornetet
I don't know how to send to the default printer, but to send ascii text to a windows printer, you can share the printer, then open the share just like a normal file. You may have to send a final form-feed character to get the last page out of the printer. Open FILE

RE: Win32::MsgBox highlight text?

2009-09-30 Thread Ken Cornetet
You could drive Internet Explorer Win32::OLE, or even simpler: Open FILE temp.htm Print FILE h1This is a message/h1; Close FILE System(iexplore temp.htm); -Original Message- From: perl-win32-users-boun...@listserv.activestate.com

RE: Advice requested, porting unix perl app to windows

2009-06-03 Thread Ken Cornetet
Serve-U has an FTP server that does both types of secure FTP (ftp over ssh and ftp of ssl). The cost for a single server is fairly reasonable, if memory serves. I know of no free (in either sense) secure FTP server for windows. Can you turn the sense of the transfers around? In other words,

RE: WMI remote querying

2009-03-24 Thread Ken Cornetet
Try it like this: use strict; use Win32::OLE; use constant wbemFlagReturnImmediately = 0x10; use constant wbemFlagForwardOnly = 0x20; use constant WbemAuthenticationLevelPktPrivacy = 6; my $computer = xxx; my $admin = yyy; my $pwd = zzz; my $wbem =

RE: Win32::Printer???

2009-02-23 Thread Ken Cornetet
If memory serves, you can share the printer, then just treat it like a UNC file path. For example, if your computer is named FOGHORN and you share the printer as LEGHORN, you can do this: Open FILE, foghorn\\leghorn Print FILE ... Close FILE -Original Message- From:

RE: Hitting a line limit while reading a file

2007-03-14 Thread Ken Cornetet
That character would be a ^Z, which is an end-of-file indicator for microsoft. I can already hear people asking Why the need for an EOF character when MS file systems record an exact byte count? Ok, maybe it's just the usual voices in my head that I hear, but for at least their edification, I'll

RE: Portable version of Perl for Windows

2006-12-11 Thread Ken Cornetet
If you just need to run perl programs, copy your perl folder to your USB drive. Don't worry about Config.pm or your PATH. Just execute your perl program like this: X:\Perl\bin\perl.exe X:\YourPerlProgram.pl where X is the drive letter of your USB device -Original Message- From: [EMAIL

RE: Parallel Port module

2006-10-24 Thread Ken Cornetet
I've never had the opportunity to use this, but it looks like it might do what you all want http://www.winfordeng.com/products/portio32/ You'll probably have to google a bit for how to get the parallel port in the mode that you want to use. -Original Message- From: [EMAIL PROTECTED]

RE: Printing to Network Printer

2006-07-28 Thread Ken Cornetet
Open the printer share name. For example, if the computer that the printer is set up on is called chworktap, and the printer share name is wagstaff, then your open should look like this: Open FILE, chworktap\\wagstaff Your post mentions an IP address and port 9100 (typically used by network

RE: rand() not so random

2005-12-02 Thread Ken Cornetet
What makes you think the same sequence repeats? The existence of like named files does not imply they were generated in the same sequence. Lets say that on one day rand() produced the sequence a,b,c,d,e,f,g,h,i,j. The next day it might produce the sequence c,h,a,e,g,b,i,d,f,j. This would not be

RE: Hashes

2005-09-23 Thread Ken Cornetet
That is a variant data type. See the docs under Win32::OLE::Variant -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gallagher Timothy-TIMOTHYG Sent: Friday, September 23, 2005 2:00 PM To: perl-win32-users@listserv.ActiveState.com Subject: Hashes I have

RE: Creating outlook calendar items

2005-08-22 Thread Ken Cornetet
It really doesn't need a module - using the outlook object model is pretty simple. Here's something I whipped up to put some training in my calendar this year. use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; use Win32::OLE::Variant; use Date::Manip; $ENV{TZ} = EST5EST;

RE: Forms for local perl scripts?

2005-07-29 Thread Ken Cornetet
The answer depends on how portable you want your application. If you need portability across windows and unix, the perl interface to Tk, or wxPerlaregood bets. If your code will run only on windows and you like using HTML forms, you can use Win32::OLE to "drive" IE. From: [EMAIL

RE: send output to a parallel port?

2005-07-20 Thread Ken Cornetet
Writing to an IO port from a user program isn't allowed under NT/2k/XP. To do this you need some sort of driver. Check out http://www.winfordeng.com/products/portio32/#samples -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sisyphus Sent: Wednesday,

RE: Change in goto behavior

2005-07-14 Thread Ken Cornetet
Bleh, Dijkstra is a quiche eater... Real programmers can write FORTRAN in any language http://ces.iisc.ernet.in/hpg/dhruba/Real.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hugh Loebner Sent: Wednesday, July 13, 2005 9:26 PM To: Michael Erskine

RE: un - Gzipping?

2005-07-07 Thread Ken Cornetet
There is a win32 port of unix tools at http://unxutils.sourceforge.net/ which includes gzip. I use it all the time. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of $Bill Luebkert Sent: Thursday, July 07, 2005 3:35 PM To: Gardner, Sam Cc:

RE: Perl as CGI writting to shares

2005-05-26 Thread Ken Cornetet
Or have your script do an explicit logon to the target server: if( ! Win32::Lanman::NetUseAdd( { remote = $target\\ipc\$, username = UsernameGoesHere, password = YourPassword, domain = , asg_type = USE_IPC

RE: drag'n'drop onto desktop icon ???

2005-05-24 Thread Ken Cornetet
Create a batch file, and create a shortcut on the desktop to the batch file. The batch file should look like this: C:\perl\bin\perl.exe YourPrelScript.pl %1 %2 %3 %4 %5 %6 %7 %8 %9 Notes: 1. Only works for a max of 9 files dropped on the icon. CMD has a shift operator which, coupled with a for

RE: cdo win32-ole object model guard

2005-04-20 Thread Ken Cornetet
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. -Original Message-

RE: Modem File Transfer help

2005-04-19 Thread Ken Cornetet
://www.ohse.de/uwe/software/lrzsz.html is decended from the old free rz/sz. Here's some other stuff: http://web.mit.edu/afs/athena.mit.edu/astaff/project/telnet/src/omen/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 1:19 PM To: Ken Cornetet; perl

RE: Bitmap Display

2005-02-24 Thread Ken Cornetet
Drive IE via OLE use strict; use Win32; use Win32::OLE; my $ie = Win32::OLE-new('InternetExplorer.Application'); $ie-Navigate(about:blank); $ie-{Toolbar} = 0; $ie-{StatusBar} = 0; $ie-{Width} = 800; $ie-{Height} = 400; $ie-{Left} = 0; $ie-{Top} = 0; while( $ie-{Busy} ) { Win32::Sleep(200); }

RE: Intercept IE or Netscape

2005-02-08 Thread Ken Cornetet
It would probably be easier to drive IE via OLE my $ie = Win32::OLE-new('InternetExplorer.Application'); $ie-Navigate(http://whatever;); $ie-{Toolbar} = 0; $ie-{StatusBar} = 0; $ie-{Width} = 800; $ie-{Height} = 400; $ie-{Left} = 0;

RE: Opening a file over a share in an authenticated cgi process

2005-01-31 Thread Ken Cornetet
Integrated windows authentication cannot hop across machines. While your script does indeed run on the IIS server as MYDOMAIN\myaccount, those credentials are not usable on \\server Use plain text authentication and it will work. I *think* this behavior can be changed by tweaking kerberos, but I

RE: Perl GUI Programming

2005-01-21 Thread Ken Cornetet
Dirk, one frequently overlooked option for a windows GUI is to drive IE via the Win32::OLE module. This works pretty well for simple applications. If you already know HTML fairly well, there's less of a learning curve than some of the other options. There are some examples (in VBScript) at

RE: problems with DBD::Oracle

2004-12-16 Thread Ken Cornetet
This is tickling a forgotten memory somehow... I seem to recall this having something to with IISLockdown and possibly some explicit denies added to various directories. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Deighan Sent: Thursday,

RE: perl and Microsoft Exchange e-mail

2004-12-13 Thread Ken Cornetet
Actually, using the outlook object via Win32::OLE is pretty easy (relatively speaking). Using OLE with MAPI on the other hand is a PITA. Suresh, can you describe your requirements a bit more fully? Paul is correct in that POP3 and SMTP are simpler to use, but they are limited to sending/receiving

RE: using perl without installing it

2004-11-19 Thread Ken Cornetet
This works just fine without any additional work. If your Perl tree is D:\Perl Then you just run D:\perl\bin\perl YourScriptHere.pl Perl will figure out where it was run from, and find all of it's modules relative to that. We frequently need to run perl scripts from login scripts. We simply

RE: Remote Stat - Slow??

2004-11-17 Thread Ken Cornetet
Here's my filetime to epoch conversion code (it is a bit shorter): sub vtfiletime { my $vt = shift; $vt = substr($vt, 0, 11); # strip off anything past seconds $vt -= 11644473600; # change offset to jan 1, 1970 return $vt; }

RE: Remote Stat - Slow??

2004-11-17 Thread Ken Cornetet
It's passed as a string. -Original Message- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 12:02 PM To: Ken Cornetet Cc: [EMAIL PROTECTED] Subject: Re: Remote Stat - Slow?? Ken Cornetet wrote: Here's my filetime to epoch conversion code (it is a bit

RE: Win32::OLE-new(MAPI.Session) generates Cannot change thread mode after it is set.

2004-11-12 Thread Ken Cornetet
Title: Message Win32::OLE-Initialize(Win32::OLE::COINIT_OLEINITIALIZE);my $session = Win32::OLE-new("MAPI.Session"); -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Warner, JimSent: Friday, November 12, 2004 1:21 PMTo: '[EMAIL

RE: FileTimeToDosDateTime

2004-10-29 Thread Ken Cornetet
Here's my code to convert from VT_FILETIME (the goofy 100ns since 1601 format) to epoch time (# seconds since 1/1/70) sub vtfiletime { my $vt = shift; $vt = substr($vt, 0, 11); # strip off anything past seconds $vt -= 11644473600; return $vt; }

RE: HOWTO Encrypt mail for MS OUtlook

2004-08-19 Thread Ken Cornetet
We did this on a past project using ASPEncrypt, which is fairly inexpensive. We called it from VBScript, but it could be called from perl (using Win32::OLE) as well. Note that I've never tested it from perl, just that it looks like it should work. -Original Message- From: [EMAIL

RE: conversion from intel hex to bin

2004-04-21 Thread Ken Cornetet
Why do you need to convert to binary? If I understand your message correctly, you simply set the eprom programmer to receive data in Intel hex format, then download the Intel hex file to the programmer. You should not have to do the conversion. If you really want to convert, here is a web page

RE: perl executable

2004-03-17 Thread Ken Cornetet
You can run perl from another machine. Install Perl on one machine, and create a share to c:\perl (assuming that's where you install it). For example: install perl and any required modules on machine foo. Share c:\perl as perl. Then, on the client machine you can run \\foo\perl\bin\perl

RE: :Oracle

2004-03-09 Thread Ken Cornetet
Title: Message I don't believea binary distributioncan be made available because of Oracle's restrictive licensing on the Oracle client libraries. This has been a major sore point. If memory serves, ActiveState was trying to work with Oracle on a license change so that it could be

RE: Reading Mail from Exchange Folder

2004-01-14 Thread Ken Cornetet
use strict; use Win32::OLE qw(in with OVERLOAD); # outlook profile my $sender = Ken Cornetet 1; my $passwd = ; # your password here # # PROGRAM STARTS HERE # # Create a new MAPI Session # print Initialising OLE MAPI...\n; Win32::OLE-Initialize(Win32::OLE::COINIT_OLEINITIALIZE); # needs

RE: build perl 5.8.1 with gcc-3.3.1 w32api-2.4 and dmake-4.1pl1-win32

2003-12-23 Thread Ken Cornetet
You will not be able to use modules containing compiled code without compiling them yourself. However, I must say I *really* like the idea of using mingw to create the standard windows binararies. Does anyone else think a mingw compiled perl (vs MSVC) is a good idea? -Original Message-

RE: Validate user from web form to active directory

2003-10-01 Thread Ken Cornetet
If your web server is windows based, you could use UserCheckPasswd from Win32::AdminMisc if( Win32::AdminMisc::UserCheckPassword(, $User, $Password)){ print Password is correct.\n; }else{ print Password is not correct.\n; } If your web server is not windows based, you could use

RE: How do I get DLL file versions

2003-09-24 Thread Ken Cornetet
Win32::AdminMisc has functions for doing this, but it has some major limitations: 1. Doesn't always work (some files cause Perl to crash) 2. Doesn't work on Windows 9X/Me 3. Latest version requires MSVCR70.DLL Here's what I've used as a replacement: sub FileVersion { use Win32::OLE;

RE: Perl editors

2003-09-23 Thread Ken Cornetet
I guess I'm old then, because I've actually done that. On my first co-op I used an ancient HP 2100 mini computer (with 8K 16 bit words) of *core* memory (that was when memory was really memory - it didn't go away when you turned the machine off). That machine didn't have any sort of boot rom

RE: PerlSvc

2003-03-12 Thread Ken Cornetet
How about an alternate method? Install Autoexnt from the NT resource kit. Set your service to start manually. Create an Autoexnt.bat that waits until the database service is started before doing a net start YourServicehere. -Original Message- From: John Deighan [mailto:[EMAIL

RE: Question about IIs

2003-02-14 Thread Ken Cornetet
I do not believe the following statement to be true: A site ends up in the Internet zone based on whether the server name has a dot in it. I'm looking at my default home page right now (kww.my.kimball.com) which is an intranet application using integrated authentication. The bottom of the IE

RE: WAV to MP3

2003-01-23 Thread Ken Cornetet
Probably not quite what you are looking for, but works for me... system(lame.exe --r3mix -V 0 -q 0 tmp.wav \$base.mp3\); If you wanted to get a bit fancier, I suppose you could use the DLL version of lame and Win32::OLE If you are asking for a pure perl mp3 encoder, I don't think such a beast

RE: User Full Name from Active Directory

2003-01-07 Thread Ken Cornetet
Title: Message Use LDAP via the Net::LDAP module. Search with filter: (samAccountname=userid) (where userid is the NT userid). Grab the CN attribute or the DisplayName attribute. I can provide sample code if you like. -Original Message-From: [EMAIL PROTECTED]

RE: Connecting to an Access DB

2002-10-18 Thread Ken Cornetet
Go back to the MS MDAC web site. Pay heed to the note about Access ODBC drivers NOT being included in MDAC. The note goes on to explain how to get Access ODBC drivers. -Original Message- From: Simon Oliver [mailto:simon.oliver;umist.ac.uk] Sent: Wednesday, October 16, 2002 2:06 AM To:

RE: print to a printer

2002-09-25 Thread Ken Cornetet
open PR //server/printer print PR Yada, yada, yada; close PR -Original Message- From: Adam Ingerman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 8:06 AM To: [EMAIL PROTECTED] Subject: Re: print to a printer Hi all, i having a problem in the beginning of a new hack. I

RE: Exchange Server Log Files

2001-10-10 Thread Ken Cornetet
Title: RE: Exchange Server Log Files Are you talking about Exchange 5.5? If so, the logs you are looking for are in the tracking.log share of your IMS server(s). The log files are created one per day, and are tab delimited. The log file names, and log timestamps are in GMT, so be