-1

i need to create a personal folder for each user of my company.

I've tried to create a batch script using ND command and it works just with name folder without . (dot)

The name of each folder should be name.surname

   ND jonny.green,
   micheal.fox,
   laura.young

Do you have some suggestion ?

Tobias
  • 1,236
  • 1
  • 13
  • 25
  • 1
    My windows CMD does not even know the command "nd". Where did you get this? Is it part of Windows? – Tobias May 18 '16 at 08:20

2 Answers2

3

If you already have a file with the usernames, this is pretty easy with Powershell (which is integrated with Windows since Windows 7/2008R2):

Get-Content yourfilewithusernames.txt | %{New-Item -ItemType Directory $_}

Basically, you get the content of the file and pass it to the pipeline; then, for each element/line (operator %), you create a new folder which name will be the content of that line (operator $_).

curropar
  • 631
  • 3
  • 18
0
  1. create file lists.txt for all users that you need to create folder
  2. copy and save as FolderMaker.cmd

    SET _dest=P:\PersonalFolders

    SET _script=C:\Scripts path=C:\Windows\System32\

    for /f "tokens=*" %%a in (%_script%\list.txt) do md %_dest%\%%a

run with admin right

Haim Cohen
  • 111
  • 2