function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JessanelJessanel 

How to fix vscode error. I was trying to authorize my org but got this error C:\Users\username\AppData\Local\sfdx\client\bin\..\7.209.6-8ba3197\bin\sfdx.cmd"' is not recognized as an internal or external command, operable program or batch file.

I was trying to authorize my org but I got this error. So I googled what this might mean but it says to update my sfdx. I did try updating it but got the same error
C:\Users\username\AppData\Local\sfdx\client\bin\..\7.209.6-8ba3197\bin\sfdx.cmd"' is not recognized as an internal or external command, operable program or batch file 
User-added image
Anyone who have idea on this? Thanks! 
Best Answer chosen by Jessanel
SwethaSwetha (Salesforce Developers) 
HI Jessanel,

As mentioned in https://salesforce.stackexchange.com/questions/355477/sfdx-authorize-an-org-failed-to-run-in-vscode, 
1. Verify if salesforce CLI is installed successfully or not. If Salesforce CLI is already installed, check the version number by running the command "sfdx --version" in the terminal. Make sure it is the latest version.
2. Add the path of the Salesforce CLI to the environmental variables.

If updating Salesforce CLI does not fix the issue, try deleting the sfdx folder located at "C:\Users\username\AppData\Local\sfdx" and then reinstalling Salesforce CLI.

If none of the above steps work, try restarting VS Code and your machine.

Related:
https://developer.salesforce.com/forums/?id=9062I000000DKBwQAO
https://github.com/forcedotcom/salesforcedx-vscode/issues/3459
https://github.com/forcedotcom/salesforcedx-vscode/issues/2869

If this information helps, please mark the answer as best. Thank you

All Answers

SwethaSwetha (Salesforce Developers) 
HI Jessanel,

As mentioned in https://salesforce.stackexchange.com/questions/355477/sfdx-authorize-an-org-failed-to-run-in-vscode, 
1. Verify if salesforce CLI is installed successfully or not. If Salesforce CLI is already installed, check the version number by running the command "sfdx --version" in the terminal. Make sure it is the latest version.
2. Add the path of the Salesforce CLI to the environmental variables.

If updating Salesforce CLI does not fix the issue, try deleting the sfdx folder located at "C:\Users\username\AppData\Local\sfdx" and then reinstalling Salesforce CLI.

If none of the above steps work, try restarting VS Code and your machine.

Related:
https://developer.salesforce.com/forums/?id=9062I000000DKBwQAO
https://github.com/forcedotcom/salesforcedx-vscode/issues/3459
https://github.com/forcedotcom/salesforcedx-vscode/issues/2869

If this information helps, please mark the answer as best. Thank you
This was selected as the best answer
JessanelJessanel

Hi Swetha, 

Deleting the 'sfdx' folder then reinstalling the salesforce cli worked!! Thanks a lot.
(Thou before posting my question here, I've already tried the 2 options you mentioned but it didn't fix  the error.)