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);