# Start browser and auto login

At times you could have a need for some PCs out in the environment (e.g. shop floor) connected to big screens in kiosk mode to present data from Flow Portal. These PCs will likely reboot at times at which you would like them to automatically log on to a Flow Portal tab when they start up.&#x20;

This little powershell script can help with just that.&#x20;

```powershell
$pathToChrome = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
$tempFolder = '--user-data-dir=c:\temp' # pick a temp folder for user data, not always needed
$startmode = '--start-fullscreen' # '--kiosk' is another option
$startPage = 'https://url.to.the.server/client.Portal2/?page=IdOfThePage' #--incognito before the url if desired

Start-Process -FilePath $pathToChrome -ArgumentList $tempFolder, $startmode, $startPage

start-sleep -Milliseconds 5000

[Microsoft.VisualBasic.Interaction]::AppActivate("Chrome")

[System.Windows.Forms.SendKeys]::SendWait("TheUsername{ENTER}")
start-sleep -Milliseconds 500
[System.Windows.Forms.SendKeys]::SendWait("Password{ENTER}")po
```

What it does is to first set some parameters:\
**Path to the browser** - (or other program for that matter) that you would like to start \
**The temp folder** - there have been rare cases where this was needed for it to function\
**Start Mode** - if you would like it to start in full screen. Same thing as pressing F11 in Chrome\
**Start Page** - this is where you provide the full url to the portal and page to open

Then start the program with the above arguments:

**Start-Process** (with the arguments)\
**start-sleep** - It then waits (sleeps) for x millisecond, this to give it time to start the browser\
**AppActivate** - activates Crome just to make sure no other programs got the focus in between\
**SendKeys** - This will pass the keys as if they were entered by a keyboard. Assuming that the logon window is active it will enter the user name you have in the script followed by Enter. Then just do a small wait again and typing the password in the same way as username followed by Enter again, which would let you in to the desired tab. \ <br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.novacura.com/extensibility-and-integration/products/portal-2/how-to-guides/start-browser-and-auto-login.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
