How to open a Visual Studio Developer Command Prompt in Terminal? #4963

Closed
opened 2026-01-31 00:01:41 +00:00 by claunia · 6 comments
Owner

Originally created by @daldr-ntml on GitHub (Nov 13, 2019).

A Visual Studio Developer Command Prompt can be accessed by opening a cmd prompt in Windows and then running the appropriate vcvarsall.bat command file.

Is it possible to create a cmd profile that will execute that bat file automatically?

Originally created by @daldr-ntml on GitHub (Nov 13, 2019). A Visual Studio Developer Command Prompt can be accessed by opening a cmd prompt in Windows and then running the appropriate vcvarsall.bat command file. Is it possible to create a cmd profile that will execute that bat file automatically?
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 00:01:41 +00:00
Author
Owner

@ramsay-vibes commented on GitHub (Nov 13, 2019):

Sure. This is the way I have my profile configured for such a command prompt. One for x86 and one for x64 cross compiler.

"commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build/vcvars32.bat\"",

"commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build/vcvarsx86_amd64.bat\"",
@ramsay-vibes commented on GitHub (Nov 13, 2019): Sure. This is the way I have my profile configured for such a command prompt. One for x86 and one for x64 cross compiler. ``` "commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build/vcvars32.bat\"", "commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build/vcvarsx86_amd64.bat\"", ```
Author
Owner

@daldr-ntml commented on GitHub (Nov 13, 2019):

Thanks for your answer. Would I need to have unique guid for each entry? Currently I have:

    {
        "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "name": "cmd",
        "commandline": "cmd.exe",
        "hidden": false,
        "fontFace": "Cascadia Code",
        "fontSize": 10
    },
    // My profiles for VS2019 Developer Command Prompts
    {
        "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "name": "x86 VS2017 Developer Command Prompt",
        "commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build/vcvars32.bat\"",
        "hidden": false,
        "fontFace": "Cascadia Code",
        "fontSize": 10
    },
    {
        "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "name": "x64 VS2017 Developer Command Prompt",
        "commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build/vcvars64.bat\"",
        "hidden": false,
        "fontFace": "Cascadia Code",
        "fontSize": 10
    }, 

but I only see one of these profiles in the dropdown menu.

@daldr-ntml commented on GitHub (Nov 13, 2019): Thanks for your answer. Would I need to have unique guid for each entry? Currently I have: { "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "cmd", "commandline": "cmd.exe", "hidden": false, "fontFace": "Cascadia Code", "fontSize": 10 }, // My profiles for VS2019 Developer Command Prompts { "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "x86 VS2017 Developer Command Prompt", "commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build/vcvars32.bat\"", "hidden": false, "fontFace": "Cascadia Code", "fontSize": 10 }, { "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "x64 VS2017 Developer Command Prompt", "commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build/vcvars64.bat\"", "hidden": false, "fontFace": "Cascadia Code", "fontSize": 10 }, but I only see one of these profiles in the dropdown menu.
Author
Owner

@ramsay-vibes commented on GitHub (Nov 13, 2019):

Yes, each will require a unique GUID. I just incremented the last number in the duplicate GUID to make it unique.

@ramsay-vibes commented on GitHub (Nov 13, 2019): Yes, each will require a unique GUID. I just incremented the last number in the duplicate GUID to make it unique.
Author
Owner

@ffes commented on GitHub (Nov 13, 2019):

You might want to add this line to set the CMD icon:

"icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
@ffes commented on GitHub (Nov 13, 2019): You might want to add this line to set the CMD icon: ```json "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png", ```
Author
Owner

@ffes commented on GitHub (Nov 13, 2019):

Would I need to have unique guid for each entry?

When include a GUID it needs to be unique. When you don't want to set a profile as default profile a GUID is optional.

@ffes commented on GitHub (Nov 13, 2019): > Would I need to have unique guid for each entry? When include a GUID it needs to be unique. When you don't want to set a profile as default profile a GUID is optional.
Author
Owner

@daldr-ntml commented on GitHub (Nov 13, 2019):

Thank you both for your answers. All working well now.

I did find that the icon does not work without a GUID.

@daldr-ntml commented on GitHub (Nov 13, 2019): Thank you both for your answers. All working well now. I did find that the icon does not work without a GUID.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4963