私はPerlのみを使用していますが、このPerlプログラムを実行した後にInternet Explorerのhomapage URLを変更する行をコードに書き込もうとしています。
*システムファイルを呼び出すヘッダ "use Win32 :: OLE"を使用しています。
*このコードにはエラーがありません。
#!/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;
}
回答:
回答№1は2Win32 :: TieRegistry(https://metacpan.org/module/ADAMK/Win32-TieRegistry-0.26/lib/Win32/TieRegistry.pm)設定するレジストリを編集する:
[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain]
"Start Page"="http://www.example.com/"