# IOError: could not spawn 'cmd' : no such file or directory \<ENOENT\>

**URL:** <https://discourse.julialang.org/t/ioerror-could-not-spawn-cmd-no-such-file-or-directory-enoent/55898>\
**Category:** General Usage\
**Tags:** cmd\
**Created:** [February 23, 2021, 11:51pm UTC](https://discourse.julialang.org/t/ioerror-could-not-spawn-cmd-no-such-file-or-directory-enoent/55898 "2021-02-23T23:51:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![abbasn110](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abbasn110/32/22247_2.png) [@abbasn110](https://discourse.julialang.org/u/abbasn110)\
**Post date:** [February 23, 2021, 11:51pm UTC](https://discourse.julialang.org/t/ioerror-could-not-spawn-cmd-no-such-file-or-directory-enoent/55898/1 "2021-02-23T23:51:08Z")

</div>

hi  
Im kinda new on Julia. While working on REPL, when I want to switch to cmd and type it on Shell I get this error.

IOError: could not spawn ‘cmd’ : no such file or directory

I also added installation directory to environment variables but it didnt help. Is there any way I can solve it? ![ERROR](https://global.discourse-cdn.com/julialang/original/3X/7/e/7e34223bf2062a6f5a4cecc1b9e6a5ceac684d29.png)

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [February 24, 2021, 8:48am UTC](https://discourse.julialang.org/t/ioerror-could-not-spawn-cmd-no-such-file-or-directory-enoent/55898/2 "2021-02-24T08:48:38Z")

</div>

This works for me.  
What happens, if you run “cmd” in a windows shell (like cmd itself) ?  
My guess is, that you somehow messed around with your PATH environment variable.  
What gives

```julia
echo %PATH%

```

when run in a cmd shell?

---

<div class="post-metadata">

**Author:** ![abbasn110](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abbasn110/32/22247_2.png) [@abbasn110](https://discourse.julialang.org/u/abbasn110)\
**Post date:** [February 24, 2021, 2:01pm UTC](https://discourse.julialang.org/t/ioerror-could-not-spawn-cmd-no-such-file-or-directory-enoent/55898/3 "2021-02-24T14:01:31Z")

</div>

> [@oheil](#):
>
> `echo %PATH%`

cmd shell returns the paths and works well. I checked environmental variables again for any possible mistakes. the point is that when the path is not correct,Julia is not executed from cmd but when I want to run cmd from Julia Shell, I get mentioned error.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [February 24, 2021, 2:07pm UTC](https://discourse.julialang.org/t/ioerror-could-not-spawn-cmd-no-such-file-or-directory-enoent/55898/4 "2021-02-24T14:07:38Z")

</div>

> [@oheil](#):
>
> What happens, if you run “cmd” in a windows shell (like cmd itself) ?

Can you try this?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [February 24, 2021, 2:09pm UTC](https://discourse.julialang.org/t/ioerror-could-not-spawn-cmd-no-such-file-or-directory-enoent/55898/5 "2021-02-24T14:09:34Z")

</div>

Or in a Powershell, e.g.:

```julia
Windows PowerShell
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

Lernen Sie das neue plattformübergreifende PowerShell kennen – https://aka.ms/pscore6

PS C:\Users\oheil> cmd
Microsoft Windows [Version 10.0.19042.804]
(c) 2020 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\oheil>

```

---

<div class="post-metadata">

**Author:** ![abbasn110](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abbasn110/32/22247_2.png) [@abbasn110](https://discourse.julialang.org/u/abbasn110)\
**Post date:** [February 24, 2021, 3:05pm UTC](https://discourse.julialang.org/t/ioerror-could-not-spawn-cmd-no-such-file-or-directory-enoent/55898/6 "2021-02-24T15:05:08Z")

</div>

I found the problem. simply but changing to new path, I used to lose the older one. this time I tried giving multiple paths separating them by semicolon and could solve the issue.  
I appended these two paths:  
Path = %SystemRoot%\system32 # for windows shell  
and path = C:… \Local\Programs\Julia 1.5.3\bin # for Julia  
to below PATH  
Path = %SystemRoot%\system3;C:… \Local\Programs\Julia 1.5.3\bin  
and now it works.  
thanks for the help
