-
Aug 15th, 2019, 11:15 PM
#1
Thread Starter
New Member
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.
-
Aug 16th, 2019, 06:40 AM
#2
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:
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.
-
Aug 20th, 2019, 08:56 PM
#3
Thread Starter
New Member
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.
-
Aug 21st, 2019, 09:53 AM
#4
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/}""")
-
Aug 21st, 2019, 02:01 PM
#5
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
-
Aug 23rd, 2019, 09:46 PM
#6
Thread Starter
New Member
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
-
Aug 25th, 2019, 09:03 PM
#7
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|