woeiwoei 发表于 2010-3-18 13:35:53

读取INI更改IE首页[已解决]

本帖最后由 woeiwoei 于 2010-3-23 14:42 编辑

$var = IniReadSection(@ScriptDir & "\lp.ini", "section")
If @error=0 Then
    MsgBox(4096, "", "INI文件不存在!")
Else
RegWrite("HKCR\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\OpenHomePage\Command","", "REG_SZ", '"C:\Program Files\Internet Explorer\iexplore.exe" '&"$var")
EndIf
我这样写后打开IE 地址栏显示的是http://$var。没读取到数值~~怎么回事啊?

woeiwoei 发表于 2010-3-18 13:53:56

没人知道吗?帮帮我啊!

lynfr8 发表于 2010-3-18 13:57:07

RegWrite("HKCR\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\OpenHomePage\Command","", "REG_SZ", '"C:\Program Files\Internet Explorer\iexplore.exe" '&"$var")
改为
RegWrite("HKCR\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\OpenHomePage\Command","", "REG_SZ", '"C:\Program Files\Internet Explorer\iexplore.exe" '&$var)

woeiwoei 发表于 2010-3-18 14:52:21

回复 3# lynfr8


    谢谢帮忙!!

woeiwoei 发表于 2010-3-18 14:58:14

$var =IniRead("config.ini", "config", "URL","NotFound")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page", "REG_SZ","")
这个$var如何加到键值后呢?也就是说读取ini中的URL= 让他应用到 "Start Page", "REG_SZ","这里?"
我尝试了"REG_SZ","$var" au3是不报错了,但是 注册表中显示的是 $var!汗了。。其他的格式au3报错。
能再请教一下吗?在线等。急!!
谢谢3楼的大哥,RegWrite("HKCR\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\OpenHomePage\Command","", "REG_SZ", '"C:\Program Files\Internet Explorer\iexplore.exe"'&$var)这个确实没问题!!

kxing 发表于 2010-3-18 15:07:35

$var =IniRead("config.ini", "config", "URL","NotFound")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page", "REG_SZ",$var)
直接饮用变量!

woeiwoei 发表于 2010-3-18 15:26:05

回复 6# kxing


    汗了。我咋就没直接运用变量呢?
谢谢你。。。

raphaeldevil 发表于 2010-7-3 11:02:03

都是人才啊~~修改主页的东西,值得商酌啊~~

gouqijun 发表于 2011-8-18 14:54:45

IE首页修改
页: [1]
查看完整版本: 读取INI更改IE首页[已解决]