Search code examples
pythoncmdcd

I am trying to run PythonScripts and Hatch in the cmd by using the command " cd Downloads/PythonScripts/Hatch"


I am trying to run PythonScripts and Hatch on my cmd by running the command " cd Downloads/PythonScripts/Hatch" but everytime I try this, the response is " the system cannot find the path specified." May I know how to cd into the folder such that the files appear in the cmd and not in another location.

I have tried to search many websites for an answer but all to no avail. Is this a path issue? can anyone help me with this? Sorry, but I am noob at coding and programming as I just started 2 weeks ago. Thanks for anyone's help! I am using python 2.7.17 and windows 10.


Solution

  • Unless the current working directory contains a directory named Downloads, the path will not be found.

    My guess is that you want to use:

    CD /D "%USERPROFILE%\Downloads\PythonScripts\Hatch"
    

    Avoid hardcoding C:\Users\username since that might not be the correct location. The system knows the correct location and puts it into the USERPROFILE environment variable.

    If the Downloads directory is in a different location, then enter the path to it.

    CD /D "C:\the\other\place\Downloads\PythonScripts\Hatch"