Search code examples
batch-filedirectorycopymkdir

Batch Change Directory to New Directory


I have a batch script that creates a new directory with time and date stamp;

mkdir "C:\Program Files (x86)\CraftBukkit\World Backup\CraftBukkit World - %date:/=.% - %time::=.%"

Then I want to have the script copy three folders into that directory. I can easily copy them with xcopy, I just don't know how to pull the new directory that I just made to show xcopy where to put the three folders. Any help would be appreciated :)


Solution

  • You could first store the directory name in a variable, use the variable to create a directory and use the variable again for xcopy.