Skip to content

Copying sub folder only

Featured Replies

I've currently got a disc and share setup that is one folder for each of our customers, within which there are several sub folders. One of these folders contains one or more backups of that customers databases.

I need to move all of these onto a new drive, however I only want the specific folders containing the data, and not all of the other flimflam within the customer folder. This new drive is specifically for these databases, and so they can just be copied into a folder with the relevant customer name.

When I started administering this, I standardised the folder names so that any new customers we get, this folder is specifically called Data. The problem lies where we have older customers, as some of them are in folders called datasets, some Data Sets, some data-sets etc. There was no real standardised naming convention for the folders.

Without doing this manually, can you think of any way of automating this?

I'm not fussed about keeping permissions, as this is one of the reasons for the new drive.

This is on Server 2008.

open a command prompt and try "xcopy sourcefolderrootpath sourcefolderdestinationpath /s"

/s copies all subfolders that have data in and wont copy the ones that are empty.

  • Author

Won't that also copy all of the other subfolders within that customers folder though?

Won't that also copy all of the other subfolders within that customers folder though?

it will only copy the ones with data in them the empty ones wont be copied

right just reread what you are saying, you only want the database folders and files from the source to the destination.

Do these database files have any specific extensions?

  • Author

Most of them are zip or rar, but then some of them are the open database files which are dbf, cdx, fpt and dbc.

Problem is, some of the other folders will probably contain some zipped up stuff as well.

It's probably do-able with a small Windows batch file...for example:

for /R %A in (*.zip) do (stuff to copy %A to the new target location) done

...and then repeat that for each of the file types you want to move.

You could use a for loop again in the copy part to tokenise the original filename to give you a correctly formatted target filename.

Only drawback I can see is it'd pull out non-database files which matched the same extension, but, well, you'd probably have to use some mad skillz to identify and exclude those if they have no specific naming convention.

I may have something which may help.

Need to rummage on an old machine for a batch file collection I had.

EDIT: cant do this until the weekend as machine is in storage.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Important Information

Welcome to BRISKODA. Please note the following important links Terms of Use. We have a comprehensive Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.