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
Vijayaragunathan VVijayaragunathan V 

Issues in Integrating VS code with Salesforce Org

I am getting this as output when I am trying to run SFDX: Authorize an org in VS code.
Help me in resolving the issue.
Starting SFDX: Authorize an Org
13:02:46.506 sfdx force:auth:web:login --setalias VSCode --instanceurl https://login.salesforce.com --setdefaultusername
{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=e75f878c347c^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=vIvnJJR396aRXdnc9JSWmxIOvv08N_gsT4ryB2VOsLg' ] }
{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=e75f878c347c^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=vIvnJJR396aRXdnc9JSWmxIOvv08N_gsT4ryB2VOsLg' ] }
{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=e75f878c347c^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=vIvnJJR396aRXdnc9JSWmxIOvv08N_gsT4ryB2VOsLg' ] }
{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'https://login.salesforce.com//services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=e75f878c347c^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=vIvnJJR396aRXdnc9JSWmxIOvv08N_gsT4ryB2VOsLg' ] }
 
Ram Chand HeerekarRam Chand Heerekar
Hi Vijay,

To handle such errors authenticating with salesforce org. We need to add C:\Windows\System32 in the PATH variable that is available in the environment setting.

if this answers your question mark it as best answer.
 
Vijayaragunathan VVijayaragunathan V
Hi Ram,
Thanks for the idea, I have added that still the issue was not solved
 
mary anamsmary anams
We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work.
Cyberlink Promo Code (http://www.gammatech.org/)
Ram Chand HeerekarRam Chand Heerekar
There might be a possibility of your firewall blocking it
 
Vijayaragunathan VVijayaragunathan V
Hi Guys,
I have solved that issue by following the steps in https://developer.salesforce.com/forums/?id=9062I000000XwOUQA0 .
But now I am getting a new error in the problem part in vs code.
This was the error message I got when I try to run SFDX: Authorize an org,

Unable to load schema from 'https://forcedotcom.github.io/schemas/sfdx-project.json/sfdx-project.schema.json': getaddrinfo ENOTFOUND webproxyaddress.

Login.salesforce.com is opening in browser and then after providing username and password , salesforce CLI is asking access. After I provide Allow access, it was showing Localhost refused to connect in browser and the above error message in VS code.
Please help me to solve the issue.