Solved

Script to create directories from a list

Posted on 2014-11-03
2
147 Views
Last Modified: 2014-11-03
I have a file called "directories.txt" with the names of of new directories I wish to create. Let's say the contents of this file are as follows:

directoryA
directoryB

I need a Win or PowerShell script which, for each line in this file, creates a new directory with the corresponding name and, inside each one, two directories called "subdir1" and "subdir2". So, in the above example, the script will create a directory called "directoryA" and one called "directoryB", each one with directories  "subdir1" and "subdir2" inside.
0
Comment
Question by:Rothbard
2 Comments
 
LVL 9

Accepted Solution

by:
dlb6597 earned 500 total points
Comment Utility
for /f %%i in (directories.txt) do (
	md %%i
	md %%i\subdir1
	md %%i\subdir2
)

Open in new window

0
 

Author Comment

by:Rothbard
Comment Utility
Thanks!!!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
A procedure for exporting installed hotfix details of remote computers using powershell
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now