Batch file that changes URL in open browser

后端 未结 2 715
北荒
北荒 2021-01-07 08:25

I\'ve seen something like this:

start /d \"C:\\Program Files\\Internet Explorer (x86)\\IEXPLORE.EXE\" www.google.com

But this just opens a

2条回答
  •  梦毁少年i
    2021-01-07 09:14

    You should be able to do this using SendKeys, see here.

    Basically, you look at the dropdown menus of Internet Explorer (i.e. File, Edit etc) and look at the shortcut keys for what you would want to do, then you write a little bit of VBscript to send those keystrokes. You save the VBscript in a file with the ".VBS" extension and then you can just double-click it to run it. Something like this should get you started....

     set WshShell = WScript.CreateObject("WScript.Shell")
     WshShell.Run "iexplore"
     WScript.Sleep 500
     WshShell.AppActivate "Windows Internet Explorer"
     WshShell.SendKeys "www.google.com"
    

    If you have already started IE using your own START command, you can just send the keystrokes you need to control it after that and you will not need the WshShell.Run part I have.

提交回复
热议问题