利用 VBScript 呼叫 InternetExplorer.Application 物件,自動開啟網頁並填入帳密,配合 U 隨身碟攜帶,實現多裝置快速登入。原始碼可自訂目標網站與欄位 ID。

建立 IE 物件 → Navigate 開啟登入頁 → Wscript.Sleep 等待載入 → Document.getElementById 定位帳密輸入框 → 填入值 → 釋放物件。可用 InputBox 選擇不同帳號組合。
' 選擇帳號組合
index = InputBox("0--Yahoo" & vbCrLf & "1--163", "選擇信箱", 0)
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
Select Case index
Case "0" ' Yahoo
ie.Navigate "https://login.yahoo.com"
WScript.Sleep 5000
ie.Document.getElementById("login-username").Value = "your_account"
ie.Document.getElementById("login-passwd").Value = "your_password"
Case "1" ' 163
ie.Navigate "https://mail.163.com"
WScript.Sleep 5000
ie.Document.getElementById("idInput").Value = "your_account"
ie.Document.getElementById("pwdInput").Value = "your_password"
End Select
Set ie = Nothing
' 安全刪除自身(若放在加密壓縮包中執行)
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile WScript.ScriptFullName
Set fso = Nothing
.vbs 放入 加密 RAR/ZIP(強密碼),使用時解壓執行,用畢腳本自刪,避免明文帳密殘留暫存資料夾。注意:網頁元素 ID 會隨版面更新而變更,腳本需同步維護。此法屬輕量自動化示範,非企業級單一登入 (SSO) 方案。