For Windows - Open your Default Browser - Tested on VS Code v 1.1.0
Answer to both opening a specific file (name is hard-coded) OR opening ANY other file.
Steps:
Use ctrl + shift + p (or F1) to open the Command Palette.
Type in
Tasks: Configure Taskor on older versionsConfigure Task Runner. Selecting it will open the tasks.json file. Delete the script displayed and replace it by the following:{ "version": "0.1.0", "command": "explorer", "windows": { "command": "explorer.exe" }, "args": ["test.html"] }Remember to change the "args" section of the tasks.json file to the name of your file. This will always open that specific file when you hit F5.
You may also set the this to open whichever file you have open at the time by using
["${file}"]as the value for "args". Note that the$goes outside the{...}, so["{$file}"]is incorrect.Save the file.
Switch back to your html file (in this example it's "text.html"), and press ctrl + shift + b to view your page in your Web Browser.

For Windows - Open your Default Browser - Tested on VS Code v 1.1.0
Answer to both opening a specific file (name is hard-coded) OR opening ANY other file.
Steps:
Use ctrl + shift + p (or F1) to open the Command Palette.
Type in
Tasks: Configure Taskor on older versionsConfigure Task Runner. Selecting it will open the tasks.json file. Delete the script displayed and replace it by the following:{ "version": "0.1.0", "command": "explorer", "windows": { "command": "explorer.exe" }, "args": ["test.html"] }Remember to change the "args" section of the tasks.json file to the name of your file. This will always open that specific file when you hit F5.
You may also set the this to open whichever file you have open at the time by using
["${file}"]as the value for "args". Note that the$goes outside the{...}, so["{$file}"]is incorrect.Save the file.
Switch back to your html file (in this example it's "text.html"), and press ctrl + shift + b to view your page in your Web Browser.

VS Code has a Live Server Extension that supports one click launch from status bar.
Some of the features:
- One Click Launch from Status Bar
- Live Reload
- Support for Chrome Debugging Attachment

Videos
How to change my HTML browser in VS Code?
How to open HTML in VS Code?
How do I preview an HTML page in Visual Studio?
Can anyone reccomend an extenstion for previewing HTML that can show images?
If I view my webpage in chrome/a browser it shows everything correctly, but none of the VSCode preview extentions can show images. If I use <img src=> then it's a broken image link, and if I use URL("") then it just doesn't show at all.
So I know my code is correct, but is there something else I'm missing about getting the preview extentions to display images from within VSCode?
The VSCode team has developed a Live Server extension with a lot of integrations. See v1.58 pre-release notes:
Live Preview
We have developed a Live Preview extension, which hosts a local server for web development previewing!
It features an in-editor browser preview, live preview refreshing (on file change or on save), multi-root support, and more!
The extension also has a
Live Previewtask, which runs a persistent server and allows you to view server traffic and its associated files.
To learn more about what it can do, view it in the marketplace or check out its repo.
There are tons of different vscode extensions for browser previews. The one i'm using is Browser Preview.

To view .php files, you need a server, like Apache.
XAMPP is an all in one solution which offers MySQL, Apache and some other tools: https://www.apachefriends.org/index.html
Hi @dylanzz ,
Welcome to Microsoft Q&A forum.
For single html file, in VS 2022, you can click File > View in Browser (Ctrl + Shift + W) to preview it(or right-click the white space of this single html file > click View in Browser).
Besides, you can select File > Browse With… > Set as Default to change other browsers as the default browser.
Have a great day.
Best Regards,
Tianyu
- If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
I am using a current version of visual studio/visual studio code, downloaded and installed less than six months ago, and there is no such option under the file menu.


