1

我不是在寻找黑客。我家里有wifi,但我每90分钟就会断开连接,必须按回车键才能重新进入。我一直在努力尝试写一些会默默打开窗口的东西,等待它加载,按{enter}然后然后关闭窗口。理想情况下,我会让它循环运行,每 90 分钟运行一次,但只使用 Windows 调度程序就可以了。

到目前为止,这是我失败的尝试(.VBS)

    Dim oIE

Set oIE = CreateObject("InternetExplorer.Application")
set objShell = WScript.CreateObject("WScript.Shell")

oIE.Visible = 1 ' Usually Hidden

oIE.Navigate "http://www.autohotkey.com"' anysite will work as if I'm logged out I will be automatically redirected to login

Do While (oIE.Busy)
Wscript.Sleep (10)
Loop

ObjShell.SendKeys "{enter}"

Do While (oIE.Busy)
Wscript.Sleep (10)
Loop

ObjShell.sendkeys "^W"

Wscript.Sleep (5400000)

所有这一切都是在没有延迟的情况下打开新页面。我见过一些我尝试过的更复杂的版本,但没有任何效果。我真的很感激任何帮助,只要能完成工作,任何格式都可以。

4

1 回答 1

0

Here's one code you can try.

set WshShell = WScript.CreateObject("WScript.Shell")
call WshShell.Run("http://www.gmail.com", 1, false) 'This will open your default browser

WScript.Sleep 3000
WshShell.SendKeys "username"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "password"
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "%{F4}"
WScript.Quit()

Try this. It worked Automatic login to a website on windows 7/Chrome via batch file

You just have to wait while this runs. The browser which it opens should be active, then the send keys will type the username, password, enter and then close the window.

于 2013-07-04T04:12:55.930 回答