Opening browser on a variable page using vbscript

前端 未结 4 683
猫巷女王i
猫巷女王i 2020-12-11 07:24

I\'m trying to write a bit of VBScript to open a browser on a specific webpage. Ultimately this webpage would be unique per script. At the moment I have the following code w

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-11 07:59

    I found the easiest way is to do this:

    set WshShell=WScript.CreateObject("WScript.Shell")
    WshShell.run "chrome.exe"
    WScript.sleep 400
    WshShell.sendkeys "URL HERE"
    WshShell.sendkeys "{ENTER}"
    

    also just a fyi you can do this to close chrome:

    WshShell.sendkeys "%{F4}"
    

提交回复
热议问题