Creating one click deploy and open url script on Windows

Hey guys, this is my first post here.

I’d like to know what is the easiest way to use a script that automates manual deployments on demand using netlify-cli on Windows and at the end of the deployment open the website draft URL using the the default browser.

I’ve run netlify deploy --help that displayed the option -o, --open Open site after deploy.
Unfortunately I am unable to get this feature/option to work when using netlify deploy --open and netlify deploy --prod --open which did not open site after deploy.

I’m trying to create a one-click script on Windows that manually deploys site and opens the URL.
So far I’ve just created a batch file with the following:

cd "%USERPROFILE%\website"
netlify deploy --dir=_site --open

Version information:

Windows 10 Pro v2004, build 19041.630

netlify -v
netlify-cli/2.68.4 win32-x64 node-v14.15.0

npm -v

Hey @James3 and welcome :slight_smile:
Does netlify open:site or netlify open --site work when it’s not chained as part of netlify deploy? Knowing that will at least help us narrow the scope of the issue.

I’ve updated the version to netlify-cli/2.68.7 win32-x64 node-v14.15.0
Tried running the mentioned commands using PowerShell and regular command prompt and the website will not open. My default web browser is FireFox.

hey @James3,

Sorry to be slow to get back to you - I tried to reproduce this but didn’t have much success.

Can you look through the issues on here:

and see if anything in there seems appropriate? if not, please file a new issue!