ed0z16k Posted October 12, 2012 Posted October 12, 2012 Hi All, I need help creating a Script file to create folders inside of other folders. The specific issue I am having is I need to create Documents and a Photos folder inside of others. I have a list of over 100 usernames, (all with different names but on the same directory). All these folders are empty and I wish to create the two folders inside of the username. Having a script like this would save me a great deal of time. Can anyone shed some light on this? Thanks
ChrisH Posted October 12, 2012 Posted October 12, 2012 Just go to the command prompt CD to the root of the directory and type: for /d %i in (*) do mkdir %i\Photos && mkdir %i\Documents Simples.
ed0z16k Posted October 12, 2012 Author Posted October 12, 2012 Brilliant, Would love to know what all the commands mean.
ChrisH Posted October 12, 2012 Posted October 12, 2012 for /d A loop that goes through directories %i This holds the name of the current directory it has found in (*) Use a wildcard for working with multiple directories mkdir %i\Photos && mkdir %i\Documents and finish with 2 make directory command joined together with an and (&&). Every pass the %i is converted to the current folder. for /d - Loop through directory | SS64.com
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now