使用Perl更改Internet Explorer的URL主页 [英] Using Perl to change the url homepage for Internet Explorer
本文介绍了使用Perl更改Internet Explorer的URL主页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我仅使用Perl,并且尝试在运行此Perl程序后的代码行中更改Internet Explorer的Homapage网址.
I am using Perl only, and I am trying to code-in the lines that would change the homapage url for Internet Explorer after running this Perl program.
*我正在使用标题"use Win32 :: OLE",它在系统文件上调用.
*I am using the header 'use Win32::OLE' which calls on a system file.
*此代码没有错误.
#!/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 address bar)\n";
chomp($url=<STDIN>);
while (!$url)
{
print "You did not make and entry! Please enter a url.\n";
chomp($url=<STDIN>);
}
while ($url)
{
if ($url =~ /\s/)
{
print "That's not a url! You entered a space somewhere. Re-enter:\n";
chomp($url=<STDIN>);
}
*CODE FOR SETTING HOMEPAGE IN INTERNET EXPLORER HERE*
print "\nYour home page in IE has been changed! Re-open IE and see!";
exit;
}
推荐答案
You could use Win32::TieRegistry (https://metacpan.org/module/ADAMK/Win32-TieRegistry-0.26/lib/Win32/TieRegistry.pm) to edit the registry to set:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Start Page"="http://www.example.com/"
这篇关于使用Perl更改Internet Explorer的URL主页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文