VSCode spawn C:\WINDOWS\system32\cmd.exe ENOENT

I have seen this message many times on posts, but I still can’t find a solution that works. I’m running Git version 2.43 on my Windows 10 machine and VSCode version 1.85.1. The cmd.exe file does exist within the path in question.

The problem extension is for Ansible.

Anytime I’m working with an Ansible file, I receive the error below:

It doesn’t prevent me from editing and/or creating playbooks, but it’s annoying to see it all the time. I have reinstalled the Ansible extension multiple times with no success.

2 Likes

did you manage to solve this problem? I have the same…

@Sergey_Kozintsev No, sir, I sure have not. It’s still a mystery that even VSCode updates have yet to fix along with any Ansible plug-in updates.

1 Like

Same here guys…
Anyway how did you proceed with installation of ansible-lint on Windows?
I tried with WSL but it doesn’t work as I expected. Sorry for offtop.

@BlackCrow77 The only method I used was via WSL as well, but no joy. I’m still receiving the error and can’t get it to disappear.

When im connected to WSL in VS code I dont receive the error, only locally.
Im kind of interested in what you mean with “doesn’t work as I expected” ? Because in my case it doesn’t seem to use/recognize the .ansible-lint config file. Same problem for you? sry for offtop guys.

This is a known issue, but it is not a bug. This happens when the Red Hat Ansible extension tries to run ansible-lint on Windows, but can’t because ansible and ansible-lint doesn’t exist on Windows. The solution is to configure remote extensions for VSCode to run on a remote linux instance (such as inside WSL or a remote linux machine over ssh), or to use VSCode directly on Linux.

Please see marko-hologram’s comment:
https://github.com/ansible/vscode-ansible/issues/681#issuecomment-1399360498

2 Likes

@Denney-tech Thank you. Much appreciated for the feedback. I will take it and run with it!

Thank you! I run this in WSL using your link.

For those that want to know, I use WSL now and that has cleared up the error. So the point to it all is like @Denney-tech mentioned just run VSCode on either Linux or WSL on Windows.

@marshit If you could mark my comment as the answer so that thread shows solved, it will help future readers to find the answer faster.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.