Hi! In this entry I'm going to show you a cool trick to set up a .bat file - which is an executable script in Windows- that will allow you to create new project folders on your PC for your projects.
What it does:
Essentially, we're creating a file that you can double click, and it will create an organized structure of folders that you've previously set up.
How is this different from having an empty template folder?
It's not too different -so if you're happy with that, I think that's the better way to go. However, there are some advantages to the script. For one, you won't need to have a default template folder structure lying around. Secondly, you can make this script prompt you for as many details from the project as you want, and it will automatically rename the folders based on that. You can ever set up some variables for folder naming!
That being said, let's get to it. You can start off by creating a .txt file. You can do this by either opening your notepad, or by right clicking inside folder and selecting > New > .txt file in the context menu. Once we're in the .txt file, we're going to write down a few lines. That's what our PC will read and act upon when executing the script. Firstly, the line
@echo off
This line basically tells the script to work "in the background".
Secondly, we're going to give a name to the script, just so that when the windows for the prompt pop up, they have a name.
@echo off
title Create Project Folders
Thirdly, we're going to set up three variables. What this means is, we want our script to ask us, every time it's executed, for the name of our project, and the client. You can add as many variables as you want, and therefore customize every folder structure as much as you want. We're starting with two:
@echo off
title Create Project Folders
set /p client=Client Name:
set /p project=Project Name:
With these two new lines, the project will ask us for a "Client Name" and a "Project Name", and store those values in the variables project and client respectively.
And now for the actual folders. Here we're going to set up just one more variable to make our lives a little bit easier. This directory variable will essentially be the directory on which we want the folders to be created. For me, that's "A:\Dropbox\Honear\Work", but you can use any directory you want. We'll set it up like this
@echo off
title Create Project Folders
set /p client=Client Name:
set /p project=Project Name:
set directory=A:\Dropbox\Honear\Work
After this, we just have to ask the script to create the folders using our variables. Let's say we want something like: (Drop down)
For almost each folder we want to create, we will have to write down a line of code. However, if we're creating the folder "Bin" inside "Assets", the "Assets" folder will also be created. So we can skip some. We start by typing "md" - a function that creates a new directory - and then our path, using the variables. The example for "Bin" is:
md "%directory%\%client%\%project%\Assets\Bin"
When the script goes through this line, it will replace those variables with your input. For me, this would result in
A:\Dropbox\Honear\Work\Client Name\Project Name\Assets\Bin
Now all that's left in this text file is to type down the rest of the folders you want to create. Your final text file would read something like this:
@echo off
title Create Project Folders
set /p client=Client Name:
set /p project=Project Name:
set directory=A:\Dropbox\Honear\Work
md "%directory%\%client%\%project%\Assets\Bin"
md "%directory%\%client%\%project%\Assets\Bin"
md "%directory%\%client%\%project%\Assets\Downloads"
md "%directory%\%client%\%project%\Assets\From Client"
md "%directory%\%client%\%project%\Project Files\C4D"
md "%directory%\%client%\%project%\Project Files\Houdini"
md "%directory%\%client%\%project%\Project Files\Fusion"
md "%directory%\%client%\%project%\Dailies"
md "%directory%\%client%\%project%\Deliverables"
md "%directory%\%client%\%project%\Documents"
The final step is to save your file, and rename the extension so that it reads ".bat" instead of ".txt". Windows will ask you if you're really sure and you'll say yes. After that, try double clicking on the file and it should prompt you for your variables! If you need to edit the .bat file, you can right click on it, and then select "Edit" and it should open it again on your text editor.