Results 1 to 7 of 7

Thread: Open Web Page in Full Screen

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2019
    Posts
    4

    Open Web Page in Full Screen

    Hi all,

    I have pretty much no experience with VB, but I have found a script online that allows me to put a web page into full screen when the script runs.

    This is the script I have

    Code:
    Set oShell = CreateObject("WScript.Shell")
    oShell.Run("""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe""")
    oShell.SendKeys "~"
    oShell.SendKeys "{F11}"
    I was wondering how I can get a specific web page to open in chrome, and also how to make only one chrome window open (this script seems to open two windows). Thank you very much for your time.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,034

    Re: Open Web Page in Full Screen

    That code won't work in VB.NET as it is. It looks like it might be VBScript, which is more like VB6 but still not the same. You'll need to make a few adjustments on that basis.

    As for your question, I would expect that you need something like this:
    vb.net Code:
    1. oShell.Run($"""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" ""{url}""")
    where url is a variable containing the URL you want to navigate to.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2019
    Posts
    4

    Re: Open Web Page in Full Screen

    Thank you very much jmcilhinney,

    I was using VBscript, sorry about the confusion. I mustn't have been able to find the VBscript forum. You edit puts the browser into full screen as intended, however for some reason the string http://%7Burl%7D/ before the url which causes a few issues. I am unsure of how to manage this. Thank you very much once again for your assistance, it is greatly appreciated.

  4. #4
    Frenzied Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    1,191

    Re: Open Web Page in Full Screen

    Did you replace url in his example with the actual URL you want to open? So it would end up like this for example
    Code:
    oShell.Run($"""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" ""{http://www.vbforums.com/}""")

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    35,072

    Re: Open Web Page in Full Screen

    Are you looking to stay in VBScript, or are you looking to do this in VB.NET?
    My usual boring signature: Nothing

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2019
    Posts
    4

    Re: Open Web Page in Full Screen

    Thanks Topshot,

    I did use the exact URL, but for some reason when I run the script it puts the http://%7Burl%7D/ around it. And I am looking to use VBscript thanks Shaggy

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2019
    Posts
    4

    Re: Open Web Page in Full Screen

    Hi All,

    I have solved the issue of the VBScript putting %7Burl%7D around my url. The curly braces {} around the url prompted the issue. Since I have removed the curly braces, which I believe a variable is supposed to be housed, the script works fine.

    Here is the script I am using to open a Chrome window on a specific page, in full screen mode.

    Code:
    Option Explicit
    Dim objShell
    Set objShell = CreateObject("WScript.Shell")
    objShell.Run("""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" ""http://localhost/TurnoutSystemV1.0/ProgramFiles/initiator.php""")
    Wscript.Sleep 1000
    objShell.SendKeys "{F11}"
    WScript.Quit
    Thank you to everyone who helped me out. I appreciate it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width