Jump to content

Starting chrome with powershell

I am trying to start google chrome with a power shell script but everything that i have tried has not worked.

 

An example of what I have tried is:

Start-Process -FilePath "C:\Program Files(x86)\Google\Chrome\Application\chrome" -ArgumentList '--start-maximized'

This however throws the error that it can't find the specified application even though it is the default install location and I have checked multiple times that it is correct.

 

I want it to also start so that it full-screens the tab (usually done by pressing f11)

Link to comment
Share on other sites

Link to post
Share on other sites

maybe put ".exe" at the end of the file path?

QUOTE/TAG ME WHEN REPLYING

Spend As Much Time Writing Your Question As You Want Me To Spend Responding To It.

If I'm wrong, please point it out. I'm always learning & I won't bite.

 

Desktop:

Delidded Core i7 4770K - GTX 1070 ROG Strix - 16GB DDR3 - Lots of RGB lights I never change

Laptop:

HP Spectre X360 - i7 8560U - MX150 - 2TB SSD - 16GB DDR4

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, RadiatingLight said:

maybe put ".exe" at the end of the file path?

 

2 minutes ago, madknight3 said:

I think you're just missing the .exe at the end of the file path

i have tried it with both

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, BA64 said:

 

i have tried it with both

that is not where chrome is

 

what you did is point to a folder, ps doesn't work that way 

Link to comment
Share on other sites

Link to post
Share on other sites

19 minutes ago, BA64 said:

 

i have tried it with both

 

Note sure what to tell you then. This opened Chrome fine for me.

Start-Process -FilePath 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'

Then again, so does this

Start-Process -FilePath 'C:\Program Files (x86)\Google\Chrome\Application\chrome'

Are you sure your path is completely correct? Note that on my system there's a space before (x86), could you be missing that?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, deXxterlab97 said:

that is not where chrome is

 

what you did is point to a folder, ps doesn't work that way 

then where is chrome located? Because when i click on the executable that is stated under the directory i have provided here, it opens the browser

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, BA64 said:

then where is chrome located? Because when i click on the executable that is stated under the directory i have provided here, it opens the browser

oh my bad. yeah, i thought they were still in appdata,  still you are starting a process so you need to add .exe at the end of it

Link to comment
Share on other sites

Link to post
Share on other sites

 

3 minutes ago, madknight3 said:

Note sure what to tell you then. This opened Chrome fine for me.


Start-Process -FilePath 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'

 

I deleted everything in the file and put this in exactly as you have it here and it did not work. This is the error I get: 

 

20170602_154214.thumb.jpg.7c33995652a4da2fe74ed2f2f0bc4317.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, BA64 said:

 

I deleted everything in the file and put this in exactly as you have it here and it did not work. This is the error I get: 

 

20170602_154214.thumb.jpg.7c33995652a4da2fe74ed2f2f0bc4317.jpg

show me the file with the code

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, deXxterlab97 said:

show me the file with the code

20170602_155950.thumb.jpg.e4e1c8c35d17f7720407c75107fe08ea.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, BA64 said:

20170602_155950.thumb.jpg.e4e1c8c35d17f7720407c75107fe08ea.jpg

Is the Execution  policy set to RemoteSigned? Don't write PS script in notepad, use Windows PowerShell ISE. Also why is there a pause at the end. 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, deXxterlab97 said:

Is the Execution  policy set to RemoteSigned? Don't write PS script in notepad, use Windows PowerShell ISE. Also why is there a pause at the end. 

The pause is just so i can see the error message, its not meant to be there for the final product.

 

How do i set that execution policy?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, BA64 said:

The pause is just so i can see the error message, its not meant to be there for the final product.

 

How do i set that execution policy?

set-executionpolicy remotesigned

 

also write it with ISE for error checking, notepad isn't great

Link to comment
Share on other sites

Link to post
Share on other sites

22 hours ago, BA64 said:

20170602_155950.thumb.jpg.e4e1c8c35d17f7720407c75107fe08ea.jpg

In both the examples, you are still missing the space in the file path. You have "C:\Program Files(x86)" when you should have "C:\Program Files (x86)".

There should be a space between "Files" and "(x86)". Or at least every version of Windows I have has the space between them.

CPU: 6700k GPU: Zotac RTX 2070 S RAM: 16GB 3200MHz  SSD: 2x1TB M.2  Case: DAN Case A4

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×