Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to move a directory between two different volumes

How to move a directory between two different volumes

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
7 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sunil goyalG
    wrote on last edited by
    #1

    hi all, how can i move a directory (also sub directory and files) from one volume to other volume ? Directory.Move function fails when source and target drive are different. Please suggest

    S 1 Reply Last reply
    0
    • S sunil goyalG

      hi all, how can i move a directory (also sub directory and files) from one volume to other volume ? Directory.Move function fails when source and target drive are different. Please suggest

      S Offline
      S Offline
      Sumit Prakash Sharma
      wrote on last edited by
      #2

      Dear as much as i know you have to do complete task in two parts, first copy all the subfoloder and files in new drive location ie. from c drive's source folder to d drive's destination folder and second delete the folder exist in c driver ie, source folder

      S S 2 Replies Last reply
      0
      • S Sumit Prakash Sharma

        Dear as much as i know you have to do complete task in two parts, first copy all the subfoloder and files in new drive location ie. from c drive's source folder to d drive's destination folder and second delete the folder exist in c driver ie, source folder

        S Offline
        S Offline
        sunil goyalG
        wrote on last edited by
        #3

        hi sumit,

        sumit prakash sharma wrote:

        first copy all the subfoloder and files in new drive location

        how can i copy folder from one drive to second

        S 1 Reply Last reply
        0
        • S sunil goyalG

          hi sumit,

          sumit prakash sharma wrote:

          first copy all the subfoloder and files in new drive location

          how can i copy folder from one drive to second

          S Offline
          S Offline
          Sumit Prakash Sharma
          wrote on last edited by
          #4

          it's too easy and short code now i m going to give complete code for coping and deleting My.Computer.FileSystem.CopyDirectory("C:\SourceDirectory", "D:\DestinationDirectory") My.Computer.FileSystem.DeleteDirectory("C:\SourceDirectory", FileIO.DeleteDirectoryOption.DeleteAllContents) if above code is usefull then plz reply

          1 Reply Last reply
          0
          • S Sumit Prakash Sharma

            Dear as much as i know you have to do complete task in two parts, first copy all the subfoloder and files in new drive location ie. from c drive's source folder to d drive's destination folder and second delete the folder exist in c driver ie, source folder

            S Offline
            S Offline
            Sumit Prakash Sharma
            wrote on last edited by
            #5

            it's too easy and short code now i m going to give complete code for coping and deleting My.Computer.FileSystem.CopyDirectory("C:\SourceDirectory", "D:\DestinationDirectory") My.Computer.FileSystem.DeleteDirectory("C:\SourceDirectory", FileIO.DeleteDirectoryOption.DeleteAllContents) if above code is usefull then plz reply

            S 1 Reply Last reply
            0
            • S Sumit Prakash Sharma

              it's too easy and short code now i m going to give complete code for coping and deleting My.Computer.FileSystem.CopyDirectory("C:\SourceDirectory", "D:\DestinationDirectory") My.Computer.FileSystem.DeleteDirectory("C:\SourceDirectory", FileIO.DeleteDirectoryOption.DeleteAllContents) if above code is usefull then plz reply

              S Offline
              S Offline
              sunil goyalG
              wrote on last edited by
              #6

              Thanks a lot sumit 5 from me

              S 1 Reply Last reply
              0
              • S sunil goyalG

                Thanks a lot sumit 5 from me

                S Offline
                S Offline
                Sumit Prakash Sharma
                wrote on last edited by
                #7

                Thanks

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups