首頁
社區(qū)
課程
招聘
internet選項的設置怎么通過程序來實現(xiàn)?

 

就是這個,我看好像BAT也沒辦法實現(xiàn),這有什么辦法嗎?

收藏
2條回答
為華 2022-11-27

EXE就可以

回復
Sonshines 2022-12-6

如果您想通過程序來設置 Internet Explorer 瀏覽器的選項,您可以使用 Windows Script Host (WSH) 編寫腳本。WSH 是一種 Microsoft Windows 操作系統(tǒng)中的腳本技術,它可以用來執(zhí)行各種腳本語言,包括 JScript 和 VBScript。

 

下面是一個簡單的示例,展示了如何使用 VBScript 設置 Internet Explorer 瀏覽器的“安全”選項:

1
2
3
4
5
6
7
8
9
10
Dim ie
Set ie = CreateObject("InternetExplorer.Application")
 
' Set the "Security" options
ie.Security.Zones(1).Level = 1
ie.Security.Zones(2).Level = 2
ie.Security.Zones(3).Level = 2
 
' Save the changes and exit
ie.Quit

上面的示例代碼用來設置 Internet Explorer 瀏覽器的“安全”選項。它通過在腳本中創(chuàng)建 Internet Explorer 應用程序的實例,然后使用 VBScript 設置安全選項,最后保存更改并退出。

 

例如,腳本中第一行設置了第一個安全區(qū)域的安全級別。

 

如果您想設置 Internet Explorer 瀏覽器的高級選項,可以使用類似于上面的代碼來編寫腳本。只需要將相應的屬性和方法替換成您想要設置的選項即可。

 

例如,如果您想設置“高級”選項卡中的“提醒”選項,可以這樣寫:

1
2
3
4
5
6
7
8
Dim ie
Set ie = CreateObject("InternetExplorer.Application")
 
' Set the "Notifications" option
ie.Advanced.Notifications = False
 
' Save the changes and exit
ie.Quit

上面的代碼會禁用 Internet Explorer 瀏覽器的“提醒”選項

回復