3

I have already added the path to environment path variable.

Screenshot of path environment variable

But when I tried to execute it through cmd . I am getting the error

'youtube-dl' is not recognized as an internal or external command, operable program or batch file.

1
  • Your didn't troubleshoot this. Your mistake would apply to any or pretty much any exe file not already in the path. (i.e. to any exe not in the path properly / put into the path like you did there = not in the path!). And infact you said yourself you are meant to add the directory to the path, You are meant to add directories to the path environment variable. Look at all of them that wre there before you tried making that funny entry!
    – barlop
    Commented Mar 11, 2023 at 16:07

2 Answers 2

9

You do not add specific programs to your path, you add the folder containing your programs.

You need to remove the youtube-dl.exe from the end of highlighted line.

1
  • It worked like a charm. Thanks @mokubai
    – Aman
    Commented May 11, 2019 at 8:13
0

Create a new folder somewhere (except from C:\Windows\system32 or wherever-your-system32-is)

Name it whatever you like,

eg.

C:\youtube-dl

Then move the youtube-dl.exe inside it

C:\youtube-dl\youtube-dl.exe

Now, when adding it in your PATH it should be the name of the folder

eg.

Sample path

Then, please, close any terminal/cmd that is/are open before trying it out.

In summary, the path (folder directory) to the .exe is needed not the .exe file when declaring it in your environment variables.

This is just to elaborate Mokubai's answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .