I want to write a script to do the following:

  • Create a folder with the name I specify each time I run the script
  • Create two .txt files in the same folder

For now I'm using the following:

@echo off

The problem is that I still have to make the directories myself, drag the script into that folder and then run it. As my script and all the folders it will create will be located in the "My Documents" folder I can just run the script from there.

Optionally I would like to let Notepad++ open both text files after they have been created.

I've tried to find the answers on Google and browsed through numerous posts but can't find the answer.

  • 1
    Hints: set /p to ask for the directory name, md to create the directory, cd to change to the directory, you know how to create the files. – DavidPostill Aug 3 '16 at 15:49
  • Is break an actual command or you just type it as a placeholder before > redirection operator? I'm just wondering. – user373230 Oct 27 '16 at 5:28

Version 1 of this script is done thanks to some help I got via Facebook:

@echo off
set /p Folder= locatie nieuwe map?
mkdir %Folder%
cd %Folder%
start notepad++ "CSR.txt"
start notepad++ "KEY.txt"

Onwards to V2!

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.