I found a need to use Juno as my ISP. Juno doesn't let you use the windows dialer, it has it's own that you must use. Well, I have a task that needs to be done at a set time of day even if I'm not around to connect to the net. So this script was born.
#!/usr/bin/perl
use strict;
use warnings;
use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys);
# get the password via $ARGV[0], hard coding, or whatever
my $password;
# Append a tilde (Win32::GUITest shortcut for <ENTER>)
$password .= '~';
# This is the only way I could run the Juno dialer on WinNT 4 workstat
+ion, YMMV
system('c:/Winnt/Profiles/All Users/Desktop/Juno and Juno Platinum.lnk
+');
sleep(10);
# My Juno configuration is hosed. The dialer pops up a box saying som
+ething
# about it with an "OK" button. Press that button, I'm too lazy.
SendKeys('~');
sleep(10);
my @windows = FindWindowLike(0, " Logon");
for (@windows) {
SetForegroundWindow($_);
# my Juno installation stores my username and the cursor is ready fo
+r password entry
SendKeys($password);
}
# YMMV with sleep time
sleep(90);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.