我有这个VBScript它工作得很好,脚本没有问题,但我想在Chrome而不是IE中打开它。
我对VB脚本编程是非常非常陌生的。谁能帮帮我。
WScript.Quit Main
Function Main
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
IE.Visible = True
IE.Navigate "http://gmail.com"
Wait IE
With IE.Document
.getElementByID("login_username").value = "myuser"
.getElementByID("login_password").value = "mypass"
.getElementByID("frmLogin").submit
End With
End Function
Sub Wait(IE)
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
End Sub
Sub IE_OnQuit
On Error Resume Next
WScript.StdErr.WriteLine "IE closed before script finished."
WScript.Quit
End Sub发布于 2013-01-09 18:58:23
这是因为Chrome不支持VBScript。请参阅http://productforums.google.com/forum/#!category-topic/chrome/give-feature-feedback-and-suggestions/xHWNXByKdhM
发布于 2016-06-01 14:33:47
看一下代码。下面是启动chrome的代码
set WshShell=WScript.CreateObject("WScript.Shell")
strAnswer = InputBox("Please enter a name for your new file:")
WshShell.run "chrome.exe"
WScript.sleep 100
WshShell.sendkeys "www.google.com"
WshShell.sendkeys "{ENTER}"发布于 2022-01-07 21:01:37
不幸的是,你只能打开一些网址,你不能像在internet explorer上那样控制它。
dim objApp : set objApp=createobject("Shell.application")
objApp.Shellexecute"chrome.exe","www.google.com","","", 1https://stackoverflow.com/questions/14223765
复制相似问题