Quantcast
Results 1 to 3 of 3

Copy certain files using command prompt recreating folder structure

  1. #1
    -null- is offline Junior Member
    Enjoys Windows 7 Forums
     
    Join Date
    Feb 2009
    Posts
    17
    Windows 7/Server 2008 R2 Firefox 14.0.1

    Copy certain files using command prompt recreating folder structure

    At the moment I am using an xcopy command to copy all files with a certain extension to another folder. As the number of files in this folder increases I'd like to organise them into sub folders and have the directory structure mirrored. However I don't want the entire folder contents copied over as there are files not needed in the destination.

    My command is currently this
    Code:
    XCOPY "$(ProjectDir)usercontrols\*.ascx" "..\..\..\Website\usercontrols\" /Y
    If I organise my ascx files into sub directories, can xcopy recreate the structure but only copying the .ascx files needed in the destination. Or is there another command line utility that can do so.

    Reply With Quote Reply With Quote

  2. #2
    -null- is offline Junior Member Thread Starter Thread Starter
    Enjoys Windows 7 Forums
     
    Join Date
    Feb 2009
    Posts
    17
    Windows 7/Server 2008 R2 Firefox 14.0.1

    Re: Copy certain files using command prompt recreating folder structure

    Did a big more googling and found out about the robocopy utility. The following using that seems to work

    Code:
    ROBOCOPY "$(ProjectDir)usercontrols" "..\..\..\Website\usercontrols" *.ascx /copy:TD /s /xx /njh /np

    Reply With Quote Reply With Quote

  3. #3
    AceInfinity's Avatar
    AceInfinity is offline Member
    Computer Mainstream Pro
     
    Join Date
    Aug 2011
    Posts
    46
    Windows 8 Firefox 17.0

    Re: Copy certain files using command prompt recreating folder structure

    I was going to suggest robocopy as well before I seen that it was also suggested here. I like the fact that it's also a threading capable utility for multiple operations running asynchronously, but in general it's configurability is a +1 from me. I use it to backup my development projects folder.

    VB/C# Programming - (2012 - Present)
    ®Crestron - DMC-T Certified Programmer


    ~ "The universe is an intelligence test." - Timothy Leary ~

    Reply With Quote Reply With Quote

Similar Threads

  1. Replies: 1
    Last Post: 06-09-2012, 10:13 AM
  2. command prompt missing in accessories folder
    By vaisforlovers in forum Windows 7 Support
    Replies: 8
    Last Post: 04-08-2012, 04:57 PM
  3. command prompt to register ocx files
    By kevvyb in forum Windows 7 Support
    Replies: 18
    Last Post: 02-14-2012, 10:24 PM
  4. Replies: 0
    Last Post: 02-07-2012, 08:18 PM
  5. Replies: 0
    Last Post: 06-14-2011, 04:45 PM

Visitors found this page by searching for:

Search engine data is still being processed!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •