How to install VS Code using CMD?
Last Updated :
28 Aug, 2024
Microsoft Visual Studio Code is among the most popular coding IDEs among coders of various platforms. Its productivity and efficiency set it apart from various IDEs. It supports various languages and frameworks, a supportive community, and various available extensions, making it best suited for diverse workflows and project requirements. It is possible to install VS Code using the Command Prompt (CMD) in addition to the standard installation approach, which entails downloading and running the installer using a graphical user interface (GUI).
In this article, we'll explore the initial steps of how to install VS Code using CMD effectively.
Steps for VS Code Installation via Command Prompt
Here, we will be discussing the 6 steps to start the installation of VS code. You can install Microsoft Visual Code Studio (VS Code) from the Command Prompt (CMD) using the Chocolatey CLI (Command Line Interface). Now see the below-mentioned steps to easily install VS Code using CMD.
Step 1: Opening the Command Prompt on Windows
Click on the Search Menu on the Windows taskbar
Step 2: CMD in the search bar
Type "cmd" in the search bar, and the Command Prompt (CMD) will be displayed on the Search Menu.
Step 3: Open Command Prompt as administrator
Click on the run as administrator tab and open the Command Prompt (CMD) along with administrative power.
Confirm the prompt box by clicking Yes when prompted on the windows with a message.
Step 4: Install Chocolatey
You have to install Chocolatey if not already installed. Otherwise, skip this step.
To install, run the following command in Command Prompt (CMD):
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Another method is to manually Install chocolatey on Windows Computer.
Step 5: VS Code Installation
After completing installation of Chocolatey run the following command in Command Prompt (CMD) to install the Visual Studio Code:
choco install vscode
and follow the prompts in the Command Prompt (CMD) to complete the successful installation.
Step 6: Opening the VS Code
To open Visual Studio Code from the Command Prompt (CMD) itself run 'code' in the Command Prompt (CMD) or search "Visual Studio Code" in the Windows Search Bar to open it.
Step 7: Verify the VS Code installation process using CMD
You may confirm that the VS Code was successfully installed once the installation is finished. Also, you need to check the updated version of VS Code in your system.
Open CMD and type code --version to verify and see the updated version of VS Code.
Conclusion
Using the Command Prompt to install Visual Studio Code is a simple and quick approach that only requires a few commands. When installing VS Code without the use of a graphical user interface, automation, and remote setups are some situations in which this method comes in handy. Should you run into any problems while installing, please consult the VS Code documentation or get in touch with their support staff.
Also Read