Terminal: Adding VS dev command prompt to profiles.json doesn't work

Created on 23 Jun 2019  路  4Comments  路  Source: microsoft/terminal

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.

Needs-Tag-Fix Product-Terminal Resolution-Duplicate

Most helpful comment

Triple-quotes made it work for me:

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

All 4 comments

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

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
        }

Triple-quotes made it work for me:

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

This works for me:

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

Was this page helpful?
0 / 5 - 0 ratings