2016-08-12 52 views
0

我正在試圖製作一個VBScript,它會向圖片中的IE本地Intranet設置添加例外。我認爲這是可能的,因爲我讀過。將受信任的站點添加到IE本地Intranet

enter image description here

我試了幾種解決方案,包括下面的一個,而且感覺我無處可去! 該腳本將在Windows 7 Pro計算機上運行,​​如果有任何幫助的話。

AddTrustedSite "//192.168.0.10" 

Function AddTrustedSite(strDomainName) 
    Set WshShell = Wscript.CreateObject("Wscript.Shell") 
    strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\" 
    WshShell.RegWrite strRegKey & strDomainName & "\", "", "REG_SZ" 
    WshShell.RegWrite strRegKey & strDomainName & "\*", "2", "REG_DWORD" 
End Function 
+2

定義「無處可去」。什麼不按預期工作? –

+0

很明顯,我運行腳本,檢查IE設置 - >本地Intranet - >網站 - >高級和'/ 192.168.0.10'沒有得到添加。 –

+0

你檢查了註冊表位置嗎?將它與手動添加值時得到的結果進行比較。 –

回答

1

這適用於普通網絡。
但是,當在域名下的PC上使用它時,它會顯示錯誤的用戶名或密碼。當我找到它時,我會發布域的額外詳細信息。

AddTrustedSite "Range1" 

Function AddTrustedSite(strDomainName) 
    Set WshShell = Wscript.CreateObject("Wscript.Shell") 
    strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\" 
    WshShell.RegWrite strRegKey & strDomainName & "\", "", "REG_SZ" 
    WshShell.RegWrite strRegKey & strDomainName & "\:Range", "192.168.0.10", "REG_SZ" 
    WshShell.RegWrite strRegKey & strDomainName & "\file", "1", "REG_DWORD" 
End Function 
相關問題