+ Reply to Thread
Results 1 to 3 of 3

Move a Subfolder with Contents

  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Move a Subfolder with Contents

    Hi all,

    My next endeavor is to try and move a subdirectory/(folder) with all its contents to another parent folder (subfolder) on the same drive.

    Example to move: MyCityA to another State.

    Before Move:
    C:/MyCountry/MyStateA/MyCityA
    C:/MyCountry/YourStateB/

    After Move:
    C:/MyCountry/MyStateA/
    C:/MyCountry/YourStateB/MyCityA

    I've seen plenty of code and have been help with moving files, but have not had any luck
    finding any examples on moving a directory.

    MvDir

    Here's something I've not tested, but hopefully will be the start of what I need.
    Please Login or Register  to view this content.
    Last edited by bdb1974; 06-03-2010 at 04:51 PM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Move a Subfolder with Contents

    Good evening bdb1974

    You're making life very difficult for yourself, here ...
    It's as easy as renaming the folder.

    On my drive E, I have a folder called Test, containing some files, and a folder called Test2, which is empty. Using the code below will move Test (and it's files, subfolders etc) into Test2 (and rename it to NewName, just for good measure - you don't have to).
    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Re: Move a Subfolder with Contents

    Thanks Dominicb.

    That helped me out tremendously.

    Sincerely,

    BDB

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1