code terminal in VSCODE adding an extra directory to the file path

nasirjamshed19 6 Reputation points
2021-06-10T19:13:35.347+00:00

My folder in 'E:' directory is open in VSCODE but whenever I hit run, the compiler adds an extra 'e' in the path hence resulting in an error. No changes were made to anything but suddenly one day vscode decided to add an extra alphabet. When that 'e' is removed, the code runs fine.
Please help.

PS E:\COLLEGE\C++\APNA COLLEGE> cd "/e/COLLEGE/C++/APNA COLLEGE/" ; if ($?) { g++ factorial.cpp -o factorial } ; if ($?) { ./factorial } cd : Cannot find path 'E:\e\COLLEGE\C++\APNA COLLEGE' because it does not exist. At line:1 char:1

Developer technologies Visual Studio Debugging
Developer technologies C++
Developer technologies C#
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. PengGe-MSFT 3,381 Reputation points
    2021-06-11T02:48:40.427+00:00

    Hi @nasirjamshed19

    Welcome to Microsoft Q&A!

    Thank you for taking time to post this issue in Microsoft Q&A forum. Visual Studio Code is currently not supported in the Microsoft Q&A forums, the supported products are listed over here: https://learn.microsoft.com/en-us/answers/products/ (more to be added later on).

    You can ask questions and search for answers on Stack Overflow and enter issues and feature requests directly in our GitHub repository.
    Thanks for your understanding.

    Sincerely,
    Peng
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    0 comments No comments

  2. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2021-06-11T19:56:36.407+00:00

    Hello,

    Best option is to report an issue e.g.

    104867-figure1.png

    0 comments No comments

  3. chirag mathur 1 Reputation point
    2021-06-21T18:00:51.87+00:00

    Go to your Settings.json file and then remove the following sentence from it -

    "code-runner.terminalRoot":"/",

    This change to WSL is no longer required in Code Runner.

    This fixed my issue which you copied from Stack Overflow @nasirjamshed19 :)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.