我的系統是win10 這里是我打開IE的vbscript openIE.vbs
Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c start """" /max ""C:\\Program Files\\Internet Explorer\\iexplore.exe"" """ "https://www.google.com" """",vbhide
它在cmd視窗中作業
"C:\Program Files\chromeOpenIE\openIE.vbs"
但是當我使用 gpedit 在 Register 中注冊時
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\chromeOpenIE]
@="IE"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\chromeOpenIE\DefaultIcon]
@="iexplore.exe,1"
[HKEY_CLASSES_ROOT\chromeOpenIE\shell]
[HKEY_CLASSES_ROOT\chromeOpenIE\shell\open]
[HKEY_CLASSES_ROOT\chromeOpenIE\shell\open\command]
@="\"C:\\Program Files\\chromeOpenIE\\openIE.vbs\""
然后使用
chromeOpenIE://
它失敗了;
uj5u.com熱心網友回復:
您必須Exe通過您的協議處理程式運行一個。您不能直接運行批處理檔案或 VBScript 檔案。用于Cmd.exe運行批處理檔案。使用WScript.exe或CScript.exe運行 VBScript 檔案。
由于您想消除Cmd閃存,您應該消除批處理檔案的使用,只需通過WScript.exe. 如評論中所述,您的 IE 啟動器并非面向未來。使用 IE COM 自動化啟動 IE。這在 Windows 11 中有效,并且將繼續在 Windows 10 中有效,無論是否有任何“禁用”IE 的更新。
請注意,直接更新 HKEY_CLASSES_ROOT 是不好的做法,因為它表示 HKLM 和 HKCU 條目的合并視圖。您應該將處理程式注冊表項寫入 HKCU,如下所示:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\chromeOpenIE]
@="IE"
"URL Protocol"=""
[HKEY_CURRENT_USER\Software\Classes\chromeOpenIE\DefaultIcon]
@="iexplore.exe,1"
[HKEY_CURRENT_USER\Software\Classes\chromeOpenIE\shell]
[HKEY_CURRENT_USER\Software\Classes\chromeOpenIE\shell\open]
[HKEY_CURRENT_USER\Software\Classes\chromeOpenIE\shell\open\command]
@="WScript.exe \"C:\\Program Files\\chromeOpenIE\\openIE.vbs\""
OpenIE.vbs應該是這個代碼:
Set oWSH = WScript.CreateObject("WScript.Shell")
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oWSH.AppActivate "Internet Explorer"
oIE.Navigate "www.google.com"
oWSH.SendKeys "% "
WScript.Sleep 100
oWSH.SendKeys "x"
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/512488.html
標籤:IE浏览器脚本
上一篇:滑鼠懸停時在左下角隱藏網址顯示?
