At work, there is an enterprise security policy in which all executable files are allowed to work only C:\Program Filesor C:\Program Files (x86).
In Visual Studio's code settings.json, using the following settings:
{
"terminal.integrated.shell.windows": "C:\\Windows\\Sysnative\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k C:\\Program Files (x86)\\Cmder\\vendor\\init.bat"
]
}
... when initializing for the integrated terminal, I get the following error message:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Due to the amazing Windows file and directory naming convention allowing spaces, it is difficult to specify one of the paths Program File.
VSCode doesn't like it when you escape the space character, and this code gives me an error Invalid escape character in string. When I try to change a property to this:
{
...
"terminal.integrated.shellArgs.windows": [
"/k C:\\Program\ Files\ (x86)\\Cmder\\vendor\\init.bat"
]
}
... The following error message appears:
'C:\ProgramFiles' is not recognized as an internal or external command,
operable program or batch file.
Finally, trying to surround the path in quotation marks as follows:
{
...
"terminal.integrated.shellArgs.windows": [
"/k \"C:\\Program Files (x86)\\Cmder\\vendor\\init.bat\""
]
}
... gives me this error message:
'\"C:\Program Files (x86)\Cmder\vendor\init.bat\""' is not recognized as an
internal or external command,
operable program or batch file.
Cmder VSCode?