Bad variable name in WSL

Solution 1:

One solution is to use the 8.3 names.

In windows command prompt, type

cd /d C:\
dir /x

You will see something like

08/03/2020  20:20    <DIR>                       $WINDOWS.~BT
03/11/2018  16:56    <DIR>                       dell
08/03/2020  22:33    <DIR>                       ESD
06/12/2019  03:16    <DIR>                       inetpub
19/03/2019  04:52    <DIR>                       PerfLogs
06/12/2019  04:17    <DIR>          PROGRA~1     Program Files
06/12/2019  04:17    <DIR>          PROGRA~2     Program Files (x86)
03/03/2020  15:24    <DIR>          PROGRA~3     ProgramData
05/12/2019  20:39    <DIR>                       Users
12/02/2020  18:46    <DIR>                       Windows

In this case, if you want Program Files use progra~1 (it ignores case). If you want to use Program Files (x86) use progra~2