1

I have created a simple batch file to open a targetted chrome link upon windows startup.

I need assistance in launching the program (in this case the Chrome Browser), but launch it into full-screen mode.

My batch file currenly:

@ECHO OFF
SET BROWSER=chrome.exe
SET WAIT_TIME=5
@ping 127.0.0.1 -n %WAIT_TIME% -w 1000 > nul
START %BROWSER% -new-tab "www.google.com"
pause`

Solution On line 5 add -start-fullscreen after %BROWSER%

  • 2
    Possible duplicate of [Run chrome in fullscreen mode on Windows](https://stackoverflow.com/questions/27649264/run-chrome-in-fullscreen-mode-on-windows) – Squashman Jun 20 '18 at 02:10
  • 1
    it's better to use [timeout](https://stackoverflow.com/q/4317020/995714) to sleep instead of ping – phuclv Jun 20 '18 at 04:39
  • @phuclv, according to [this site](http://ss64.com/nt/timeout.html), `ping` consumes less processor time than `timeout`; but you need to set `-n 6` to wait for `5` seconds (6 requests with 5 intervals)! `ping` has got the advantage that it really waits for the given time at least, but `timeout` may wait shorter: `timeout /T 3` waits for > 2 seconds up to 3 seconds; and `timeout` does not work when _STD_IN_ is redirected, but `ping` does`; the advantage of `timeout` is that it can be interrupted by a key-press when switch `/NOBREAK` is not provided; all in all it's hard to tell what is better... – aschipfl Jun 20 '18 at 14:56
  • 1
    @aschipfl strange. It does nothing apart from sleeping, yet it consumes more CPU usage than ping. Seems a bad timeout implementation – phuclv Jun 20 '18 at 14:59

1 Answers1

1

add -start-fullscreen to the chrome command.

andy magoon
  • 2,889
  • 2
  • 19
  • 14