删除特定网站浏览历史记录的脚本

时间:2020-06-03 11:22:40

标签: vbscript

我正在尝试编写一个脚本,该脚本将仅从特定站点仅删除浏览历史记录。所以基本上,以Facebook为例。我只想删除该站点的历史记录。实际上,我只想删除其前48小时的历史记录。

到目前为止,我所拥有的:我编写了一个脚本,提示用户进行数字选择。例如: 1-Facebook 2-雅虎 3-YouTube 4-其他 5-退出

选择1-3应该只删除受关注的网站(Facebook,Yahoo,YouTube)。选择4允许我输入站点名称。选择5将自动退出程序。上面的“表”实际上是由一维数组生成的,并且选择与项的数组索引+ 1对应。

选择1到4后,系统会提示我确认删除所选站点的浏览历史记录。输入“ Y”将确认删除。

以上所述,“基本上”都是有效的。我需要输入的是如何从最近48小时内实际删除相应站点名称的浏览历史记录。我确定还有将所有文本都转换为小写字母的问题。

我对此事做了一些研究,我唯一能想到的就是这段代码,它清除了所有内容。那不是我想要的。

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1

这是我当前的代码:

Option Explicit

Dim i
Dim sites(4)
Dim outStr
Dim pintInput
Dim strInput
sites(0)="Facebook"
sites(1)="Yahoo"
sites(2)="YouTube"
sites(3)="Other"
sites(4)="Exit"

For i = 0 to UBound(sites)
    outStr = outStr & (i+1) & " - " & sites(i) & vbNewLine
Next

Do While pintInput < 1 OR pintInput > 5
    pintInput = InputBox( "Which site to clear the browsing data for?" & vbNewLine _
        & OutStr)
Loop
If pintInput >= 1 OR pintInput <= 5 Then
    If pintInput = 5 Then
        Msgbox("Choice Exit on option 5")
    ElseIf pintInput = 4 Then
        sites(3) = InputBox("Enter the name of the site to delete:")
    End If

    If pintInput >=1 and pintInput <=4 then
        Do While ((strInput <> "Y") AND (strInput <> "N"))
            strInput = InputBox( "Confirm Browsing History for : " & sites(pintInput - 1) & " (Y/N)?")
        Loop
    End If

    If strInput = "N" Then
        Msgbox("Exiting Program - Choice N")
    End If
End If

关于如何执行此操作的任何提示?

0 个答案:

没有答案