Dev Command Tool
The Dev Command Tool (devcmd) is a command-line utility designed to simplify the process of setting up your environment for developing Windows applications. It provides a convenient way to invoke MSBuild, along with other SDK-specific tools and environment variables, without requiring manual configuration.
What is Dev Command Tool?
When you install the Windows SDK, it includes various build tools and libraries. To use these effectively, your command prompt session needs to be aware of their locations and configurations. The Dev Command Tool automates this by:
- Setting up environment variables for SDK paths, build tools, and compilers.
- Configuring paths to MSBuild and other essential development utilities.
- Ensuring that the correct versions of tools are available in your PATH.
How to Use
You can launch the Dev Command Tool from the Windows Start Menu. Navigate to the Microsoft SDKs folder and select the "Developer Command Prompt" or "Developer PowerShell" shortcut corresponding to your installed SDK version. This will open a new command prompt or PowerShell window with the environment pre-configured.
From the Start Menu:
- Click the Start button.
- Type "Developer Command Prompt" or "Developer PowerShell".
- Select the relevant shortcut from the search results.
From the Command Line:
If you know the installation path of your SDK, you can directly execute the cmd.exe or powershell.exe from the SDK's bin directory. However, using the Start Menu shortcut is the recommended and easiest method.
Key Features and Benefits
- Simplified Environment Setup: No need to manually set
PATHor other environment variables. - Consistent Builds: Ensures that your builds use the correct SDK components and tools.
- Access to MSBuild: Provides direct access to MSBuild for compiling your projects.
- Integration with other SDK Tools: Easily use other command-line tools like
MakeCert,Signtool, andGuidGen.
Example Usage (within Dev Command Prompt)
Once the Dev Command Prompt is open, you can directly use MSBuild to build your Visual Studio projects:
msbuild YourProject.sln /t:Rebuild /p:Configuration=Release
You can also invoke other SDK tools:
guidgen
signtool sign /f YourCert.pfx /p YourPassword YourFile.exe