Hi! I am trying to use a Perl script, as you see below, to change the home page for Internet Explorer, but I cannot come-up with the code that does the change. I am using the use Win32::OLE header to make a call to the system. This call allows the modifying of the file that needs to be edited in the system I do know.
Thanks in advance!

#!/usr/bin/perl
use Win32::OLE;

print "What url would you like to make as Internet Explorer's home page?\n";
print "(no spaces, the url as you normally see it on the adderess bar)\n";
chomp($url=<STDIN>);

while (!$url)

    print "You did not make and entry! Please enter a url.\n";
    chomp($url=<STDIN>);
    exit;
}

while ($url)
{
    if ($url eq " ")
    {
        print "That's not a url! You entered a space somewhere. Re-enter:\n";
        chomp($url=<STDIN>);
    }
    else
    {


        *CODE TO CHANGE HOME PAGE HERE*


        print "\nYour home page in IE has been changed! Re-open IE and see!";
    }

    exit;
}

Hi jg1405,

You said, "I am using the use Win32::OLE header to make a call to the system." In Perl it's called a module, not a header :) Also, in your code, you're not actually using it to do anything; you're just including it but not calling anything defined by that module, as far as I can see.

Then you say, "This call allows the modifying of the file that needs to be edited in the system I do know." Which call? Again, you just include the module, you don't actually call anything. And which file are you talking about? Did you mean to say you don't know which file to change?

If your intention is actually to use Win32::OLE to induce IE to change the home page, that sounds a bit unnecessarily indirect to me. I'd guess that manipulating the registry behind IE's back would probably be an easier way to do it.

A little browsing of CPAN suggests that installing Bundle::libwin32 and using the Win32::TieRegistry module would be the right way to go about it. Do some web searches for something like "IE homepage registry" to find the registry key you'll need to manipulate.

HTH,

--doubi

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.