HOME | Blog | YouTube | LinkedIn | About Me         || Calculators    | SoftEng/Tech Posts    | Code/Scripts

Sunday, May 21, 2017

Opening Chrome using Windows command-line

Here is a quick post about opening Chrome browser in Windows command-line. You may be wondering why you need this. This is very useful if you want to open a bunch of tabs in Chrome and pre-load them with your favorite URLs.
This is what you need to type in Windows command-line or a Windows batch script:
@echo off
echo OPEN SOME URLS...

echo Opening chrome
start "c:\program files (x86)\google\chrome\application\chrome.exe" "https://www.youtube.com"
I am not sure if you need the same thing but I am often have a need to pre-load a YouTube video to a specific time within that video. Here is how you can do this:
(1)
Let’s assume that the link for the YouTube video is: https://www.youtube.com/watch?v=49YvbcqjEiA
(2)
In order to position the video to a specific time position, you just need to append the following to that URL: &t=1m44s
(3)
Then you get the following links: https://www.youtube.com/watch?v=49YvbcqjEiA&t=1m44s
This will position the video to 1 minute and 44 seconds.
(4)
Here is how you would do it in command-line or a batch script:
@echo off
echo OPEN SOME URLS...

echo Opening chrome
start "c:\program files (x86)\google\chrome\application\chrome.exe" "https://www.youtube.com/watch?v=49YvbcqjEiA&t=1m44s"
Thank you for reading.
Almir Mustafic


No comments:

Post a Comment