Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cmd crashes with exit code 1 after uninstalling anaconda

Problem description

I got this problem in my Win10 Pro Machine. I uninstalled Anaconda because it gaves me problem with Jupyter notebook and reinstalled it. But since then I'm unable to access Command Prompt.

As soon as I open it it closes. I figure it out opening VSCode and reading Cmd has exited with error code 1. And now nor Anaconda Prompt is starting up, but as soon as I open PowerShell it's says (conda) so I think it works from there.

powershell and cmd /d

From Powershell if i type in cmd and it exit immediately without complaining about anything. But if I type cmd /d it works.

Tried fix that didn't work

  • Removing Anaconda from path
  • I read somewhere here that it may be caused by some kind of bad command on cmd startup and in fact with cmd /d works as usual.
  • I tried to follow the registry fix about startup commands for cmd but the registry entry was missing in my case maybe this could be the issue
  • Neither sfc /scannow nor DISM.exe /Online /Cleanup-image /Scanhealth worked

Infomation i found online

According to this website ErrorCode 1 'Indicates that Action has attempted to execute non-recognized command in Windows command prompt cmd.exe'.

Actual request

Can anyone help me with this issue please? I tried to look online for a week but with no luck, thank you for your time

like image 669
Filippo Vicari Avatar asked Feb 23 '21 14:02

Filippo Vicari


People also ask

Why Anaconda prompt is not opening?

This is often the result of a corrupted . condarc file. To resolve, delete the . condarc file and restart Navigator.

How do you get out of Anaconda prompt?

That will work fine, or use ctrl-C in the Terminal to terminate the Jupyter process (it will prompt you if you really want to quit).


2 Answers

The following answer was (supposedly) initially posted (but later removed) by @Mofi and I got it from the comment of @filippo-vicari. So all credits go to them, thanks for solving this issue! It took me hours to finally find their solution.

Enter the following command into the still working powershell (in my case Anaconda Powershell):

C:\Windows\System32\reg.exe DELETE "HKCU\Software\Microsoft\Command Processor" /v AutoRun /f

It worked for me immediately. cmd.exe and Anaconda Prompt now work flawlessly again!

like image 88
crisprog Avatar answered Sep 28 '22 02:09

crisprog


I had the same problem after completely uninstalling anaconda (without reinstalling it). I was able to fix it by going to "Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor" in the registry editor and deleting the AutoRun key.

like image 43
CamelCaseCam Avatar answered Sep 28 '22 00:09

CamelCaseCam