I would like to make a batch file that:

1.open cmd.exe

2.command cmd to open a directory.

3.make a new directory by using command mkdir inside the cmd.

How can I do this?


a batch file is processessed within a cmd.

So you juste have to enter in your batch

cd "absolute path of your directory"

mkdir "folder name"

But powershell is much more powerful than batch which is kinda obsolete.

  1. Open Notepad or any text editor
  2. type the commands as is in the file.(in the manner you type on cmd) Here,

    cd "absolute/path/of/the/directory" mkdir "folder_name"

  3. Save it as a '.bat' file.

  4. Execute it. Job done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.