前段时间,忘了是哪位问是否可以根据需要编辑IE地址栏里的内容,当时没时间写,只是觉的思路不错,今天试试果然又是个懒人的好东东。把几个常用网址导入/导出后将自动完成(自动记忆)一关,呵呵,比收藏夹还方便,也不显得凌乱。
注:从txt文件导入地址栏会清空当前地址栏并用txt中的内容覆盖,因此首次使用时可先选择导出地址栏到txt文件,编辑txt文件后再导入,就不会出现地址栏被清空的现象了。
Manage_TypedURLs.rar


slore 还原源码很成功,如果可以连随机大小写也解决了就完美了
[ Last edited by baomaboy on 2008-3-24 at 11:53 PM ]
注:从txt文件导入地址栏会清空当前地址栏并用txt中的内容覆盖,因此首次使用时可先选择导出地址栏到txt文件,编辑txt文件后再导入,就不会出现地址栏被清空的现象了。
Manage_TypedURLs.rar


slore 还原源码很成功,如果可以连随机大小写也解决了就完美了
'''Manage_TypedURLs.VBS by baomaboy
'''注意生效条件,如浏览器关闭打开新窗口。
Dim WshSHell,FSO
On Error Resume Next
Set WshSHell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
CloseTime = 5
FileName = WScript.ScriptName
FileFullName = WScript.ScriptFullName
FilePath = FSO.GetParentFolderName(FileFullName)
InsPath = FSO.GetSpecialFolder(1)
InsFullName = FSO.BuildPath(InsPath ,FileName)
URLsTxt="URLsTxt.txt"
Copyright="玲珑科技"
QQ="QQ:25926183"
Email="Email:fty1995@163.com"
InsTitle="管理地址栏链接"
InsAnswer="管理地址栏链接"
RegPath1="HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\Manage_TypedURLs\"
RegValue1="管理地址栏(&G)"
RegForm1="REG_SZ"
RegPath2="HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}\shell\Manage_TypedURLs\command\"
RegValue2="wscript.exe "&InsFullName
RegForm2="REG_SZ"
IF FileFullName <> InsFullName then
intAnswer = MsgBox("【是】将“"+ InsAnswer +"”加入到桌面IE图标右键菜单,"&Chr(10)&Chr(10)&"【否】将“"+ InsAnswer +"”从桌面IE图标右键菜单删除。 ", vbQuestion + vbYesNoCancel, "安装 - "+ InsTitle +" - "+ Copyright)
If intAnswer = vbYes Then
WshSHell.RegWrite RegPath1,RegValue1,RegForm1
WshSHell.RegWrite RegPath2,RegValue2,RegForm2
FSO.GetFile(FileFullName).Copy(InsFullName)
WshSHell.popup _
"添加脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _
"添加注册表项:"+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10)+ _
chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "安装成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
end if
If intAnswer = vbNo Then
WshSHell.RegDelete RegPath2
WshSHell.RegDelete RegPath1
FSO.DeleteFile InsFullName
WshSHell.popup _
"删除脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _
"删除注册表项:"+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10)+ _
chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "卸载成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
End If
If intAnswer = vbCancel Then
end if
ELSE
If (FSO.FileExists(FSO.BuildPath(InsPath,URLsTxt))) Then
else
Set NewFile = FSO.CreateTextFile(FSO.BuildPath(InsPath,URLsTxt), True)
NewFile.WriteLine("http://hi.baidu.com/baomaboy")
NewFile.Close
end if
RegAutoSuggest = WshSHell.RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoComplete\AutoSuggest")
if Lcase(RegAutoSuggest) = "no" then
showras="关闭" : showexras="开启" : exras=Lcase("yes")
else
showras="开启" : showexras="关闭" : exras=Lcase("no")
end if
N=InputBox("当前自动记忆功能:"& showras &"。"&vbcrlf&vbcrlf&"1.导入地址栏从列表文件,"&vbcrlf&vbcrlf&"2.导出地址栏到列表文件,"&vbcrlf&vbcrlf&"3.编辑列表文件为地址栏,"&vbcrlf&vbcrlf&"4."& showexras &"地址栏自动记忆项。","浏览器地址栏管理 — QQ:25926183","1")
If N=False Then WScript.Quit
If IsNumeric(N)=False Then
WshShell.popup chr(10) &_
"请输入正确的编号值(输入数字型值)!"+ chr(10) &chr(10) & _
chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "错误提示 - "+ InsTitle +" - "+ Copyright, 0 + 48
WScript.Quit(0)
else
Select Case N
Case 1 Call URLsFormFile(Lcase("inurls"))
Case 2 Call URLsFormFile(Lcase("outruls"))
Case 3 Call URLsFormFile(Lcase("fixtxt"))
Case 4 WshSHell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoComplete\AutoSuggest", exras , RegForm1
Case Else WshShell.popup chr(10) &_
"请输入正确的编号值(注意编号范围)!"+ chr(10) &chr(10) & _
chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _
chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "错误提示 - "+ InsTitle +" - "+ Copyright, 0 + 48
WScript.Quit(0)
End Select
End if
END IF
Set WshSHell=Nothing
Set FSO=Nothing
WScript.Quit(0)
Sub URLsFormFile(exc)
if Lcase(exc) = "inurls" then
WshSHell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\",""
WshSHell.RegDelete "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\"
Set InR = FSO.OpenTextFile(FSO.BuildPath(InsPath,URLsTxt),1)
myweb = 0
i = 0
Do Until InR.AtEndOfStream
i = i + 1
WshSHell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url"&i,InR.ReadLine
if myweb = 0 then
if InStr(WshSHell.RegRead("HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url"&i),"baomaboy") > 0 then
myweb = 1
end if
end if
Loop
InR.Close
if myweb = 0 then
WshSHell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url"&i+1,"http://hi.baidu.com/baomaboy"
end if
elseif Lcase(exc) = "outruls" then
Const HKEY_CURRENT_USER = &H80000001'''remnotecbybaomaboy
strComputer = "."
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
oReg.EnumValues HKEY_CURRENT_USER,"Software\Microsoft\Internet Explorer\TypedURLs", arrValueNames,arrValueTypes'''remnotecbybaomaboy
For Each strValue in arrValueNames
If Len(strValue) > 0 Then
oReg.GetStringValue HKEY_CURRENT_USER,"Software\Microsoft\Internet Explorer\TypedURLs\",strValue,strRunCommand'''remnotecbybaomaboy
if len(strRunCommand) > 0 then
outrulstxt = outrulstxt & strRunCommand & vbcrlf
end if
End If
Next
Set OutR = FSO.OpenTextFile(FSO.BuildPath(InsPath,URLsTxt),2,True)
OutR.Write outrulstxt
OutR.Close
elseif Lcase(exc) = "fixtxt" then
WshSHell.Run ("Notepad.exe "&FSO.BuildPath(InsPath,URLsTxt))
end if
End Sub
[ Last edited by baomaboy on 2008-3-24 at 11:53 PM ]
