Menu

xcopy

In the spirit of being more than "just another Revit blog," I'm going to pepper this with some tips that I've found useful. I'll try to keep things relevant and generally on the topics of automation and productivity.

Today I rediscovered a neat little Windows command called xcopy. You may know it, but if you don't you can open up a command prompt and type help xcopy and you will be presented with a list of options.

XCOPY is a command line utility that, among other things, allows one to copy a folder structure without copying the files in the folders. This can be helpful if you want to study some changes to the structure of your project directory template or your office library. It can also be useful if you have set up a great folder structure that you want to reuse somewhere else.

The syntax I use for copying a directory tree without copying any of the files is shown below.

xcopy C:\MySourceDirectory "C:\New Directory with Spaces" /T /E

The /T switch will copy the directory structure without copying the files and the/E switch will tell it to include empty directories. If your source or destination path has spaces be sure to enclose it in quotes. There are other things you can specify, but this is what I have found useful. The best part is that it's a command line utility so you can include it in a script. You can find out more information about XCOPY by searching Google or Wikipedia.