0

everyone. I am brand new to VBscript and I need to write a script that opens whatever website based on its IP address. The following is what I have right now and it works well but I'd rather not hardcode each individual website I need to be opened.

Option Explicit 
Dim URL,WshShell,i
URL = "www.sightline.com"
Set WshShell = CreateObject("WScript.shell")
For i = 0 to 50
    WshShell.SendKeys(chr(175))
Next
WshShell.run "CMD /C start iexplore.exe " & URL & "",0,False

I would like to replace the 3rd line: 'URL = "..."' to take in an IP address instead without it being hardcoded.

Thanks,

p.s This is my first post so if anyone has any suggestions or tips on how I write my questions better if they need to be, that'd be greatly appreciated.

  • Replace `URL` with an argument passed into the script see the duplicate target for more info. – user692942 Mar 08 '22 at 16:29
  • Are you sure you want to use iexplore.exe? Many web sites won't work (or work properly) with IE. You can skip the script altogether and just launch your browser directly to a web site. For example: `chrome www.sightline.com`. – LesFerch Mar 08 '22 at 16:40

0 Answers0