Adding VS dev command prompt to profiles.json doesn't work #1947

Closed
opened 2026-01-30 22:42:40 +00:00 by claunia · 4 comments
Owner

Originally created by @afcruzs on GitHub (Jun 23, 2019).

Environment

Windows build number: 10.0.18362.175
Windows Terminal version (if applicable): 0.2.1715.0

Any other software: Visual Studio 2017 (I guess it fails with other VS versions)

Steps to reproduce

Add this entry to profile.json:

        {
            "acrylicOpacity" : 0.75,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "cmd.exe /k \"%PROGRAMFILES(X86)%\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\VsDevCmd.bat\"",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Consolas",
            "fontSize" : 10,
            "guid" : "{1748ecca-abdd-4aa4-bcc4-9fca0d045be5}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
            "name" : "VS cmd",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "startingDirectory" : "%USERPROFILE%",
            "useAcrylic" : true
        },

Expected behavior

Initializes the Developer Command prompt for visual studio

Actual behavior

The batch script does not executes and fails like this:

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Originally created by @afcruzs on GitHub (Jun 23, 2019). # Environment ```none Windows build number: 10.0.18362.175 Windows Terminal version (if applicable): 0.2.1715.0 Any other software: Visual Studio 2017 (I guess it fails with other VS versions) ``` # Steps to reproduce Add this entry to `profile.json`: ``` { "acrylicOpacity" : 0.75, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "cmd.exe /k \"%PROGRAMFILES(X86)%\\Microsoft Visual Studio\\2017\\Community\\Common7\\Tools\\VsDevCmd.bat\"", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Consolas", "fontSize" : 10, "guid" : "{1748ecca-abdd-4aa4-bcc4-9fca0d045be5}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png", "name" : "VS cmd", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "startingDirectory" : "%USERPROFILE%", "useAcrylic" : true }, ``` # Expected behavior Initializes the [Developer Command prompt for visual studio](https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs) # Actual behavior The batch script does not executes and fails like this: 'C:\Program' is not recognized as an internal or external command, operable program or batch file.
claunia added the Needs-Tag-FixResolution-DuplicateProduct-Terminal labels 2026-01-30 22:42:40 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 23, 2019):

This'll be a duplicate of #1090 actually. Thanks!

@DHowett-MSFT commented on GitHub (Jun 23, 2019): This'll be a duplicate of #1090 actually. Thanks!
Author
Owner

@Hagelkruys commented on GitHub (Jun 23, 2019):

As a temporary workaround using 8.3 directory names works for me.

 {
            "acrylicOpacity" : 0.75,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "cmd.exe /k C:\\Progra~2\\Micros~1\\2017\\Community\\Common7\\Tools\\VsDevCmd.bat",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Consolas",
            "fontSize" : 10,
            "guid" : "{1748ecca-abdd-4aa4-bcc4-9fca0d045be5}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
            "name" : "VS cmd (2017)",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "startingDirectory" : "%USERPROFILE%",
            "useAcrylic" : true
        }
@Hagelkruys commented on GitHub (Jun 23, 2019): As a temporary workaround using 8.3 directory names works for me. ``` { "acrylicOpacity" : 0.75, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "cmd.exe /k C:\\Progra~2\\Micros~1\\2017\\Community\\Common7\\Tools\\VsDevCmd.bat", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Consolas", "fontSize" : 10, "guid" : "{1748ecca-abdd-4aa4-bcc4-9fca0d045be5}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png", "name" : "VS cmd (2017)", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "startingDirectory" : "%USERPROFILE%", "useAcrylic" : true } ```
Author
Owner

@fpintos commented on GitHub (Jun 24, 2019):

Triple-quotes made it work for me:

            "commandline": "cmd.exe /k \"\"\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\Common7\\Tools\\VsDevCmd.bat\"\"\"",
@fpintos commented on GitHub (Jun 24, 2019): Triple-quotes made it work for me: ``` "commandline": "cmd.exe /k \"\"\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\Common7\\Tools\\VsDevCmd.bat\"\"\"", ```
Author
Owner

@steynpjm commented on GitHub (Nov 26, 2019):

This works for me:

"commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/Tools/VsDevCmd.bat\""

@steynpjm commented on GitHub (Nov 26, 2019): This works for me: `"commandline": "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/Tools/VsDevCmd.bat\""`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1947