We help IT Professionals succeed at work.

How to create folders from a CSV list of names?

H4Inf
H4Inf asked
on
263 Views
Last Modified: 2010-05-18
Hi,

I need to create folders which are all contained in a CSV file. Then I would like to set permissions on them.

The CSV is laid out as:
Username,FullHomePath
eg. fred,\\files\staff\fred

I also want to create a Desktop and Documents folder in each folder.

I understand VBS & CMD a bit, but I have no idea how to incorporate the CSV file with this...

eg. With CMD, per user I would want to run:

if not exist "%NewFolder%" md "%NewFolder%"
if not exist "%NewFolder%\Desktop" md "%NewFolder%\Desktop"
if not exist "%NewFolder%\Documents" md "%NewFolder%\Documents"
cacls "%NewFolder%" /t /e /g ourdomain\%NewUser%:C
::Give Teachers Access
cacls "%NewFolder%" /t /e /g Staff:R

Just need some tips on incorporating my CSV list into this...

Cheers,

Paul.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks a lot!! :D

Best regards,

Paul.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.