I needed to recreate a folder structure from one computer to another.
To be ahead of some comments I foresee, one computer did not have powershell or any internet connection (to download powershell), and I was not allowed to install anything.
To solve the problem I used “old school” DOS commands.
- Open a command prompt
- navigate to the correct folder
- execute the command: “dir /s /b /ad > createfolders.bat”
- edit the just created createfolders.bat file with an advanced text editor which supports macro’s (like download notepad++ )
- Make a macro that put’s the command “md” (make directory) on every single line, and removes the part in front of the line you don’t need (like d:\ or so)
- Copy and execute this batch file onto your computer on which you want to recreate the folder structure
Simpel.. ain’t it.









Here’s the PowerShell way:
Copy-Item -Path . -filter {$_.PSIsContainer} -Destination \\server\share -Recurse -Force
ha ha, thx Shay.
I knew this would happen.