Windows 10: How to copy 1st level directories C:\ as source using xxcopy

Discus and support How to copy 1st level directories C:\ as source using xxcopy in Windows 10 Network and Sharing to solve the problem; Hello, I want to know how to copy 1st level directories within the C:\ drive to another external hard drive. More Specifically, I just want to copy the... Discussion in 'Windows 10 Network and Sharing' started by ghostanime2001, May 20, 2019.

  1. How to copy 1st level directories C:\ as source using xxcopy


    Hello, I want to know how to copy 1st level directories within the C:\ drive to another external hard drive. More Specifically, I just want to copy the "C:\Downloads" folder into "E:". I do not want any subdirectories or files to be copied, just folders. Thank you

    :)
     
    ghostanime2001, May 20, 2019
    #1

  2. Copy Directory Keeps throwing Exceptions :[

    I couldn't find any good code for a recusive copy to point you to so I decided to write my own...

    Code: Imports System.IO Module StaticMethods ''' <summary> ''' Recursively copies a directory and files to a new location. ''' </summary> ''' <param name="source">The folder name to copy.</param> ''' <param name="destination">The name of the folder to copy to (will be created if not exist).</param> ''' <param name="recursive">Whether or not to copy sub directories.</param> ''' <param name="overwrite">Whether or not to overwrite files.</param> ''' <param name="delete_dest_before_copy">Whether or not to delete the destination directory before copying (ensures a 1:1 copy).</param> ''' <returns>An exception or Nothing if there were no problems.</returns> Public Function CopyDirectory(ByVal source As String, ByVal destination As String, Optional ByVal recursive As Boolean = True, Optional ByVal overwrite As Boolean = True, Optional ByVal delete_dest_before_copy As Boolean = False) As Exception Try ' Delete the destination directory if the option is true. If delete_dest_before_copy Then If Directory.Exists(destination) Then Directory.Delete(destination, True) End If ' Get information about the source directory and destination directory. Dim source_info As DirectoryInfo = New DirectoryInfo(source) Dim dest_info As DirectoryInfo = New DirectoryInfo(destination) ' Make sure the directory exists. dest_info.Create() ' If set to act recursively, perform the option for all sub directories. If recursive Then For Each dir As DirectoryInfo In source_info.GetDirectories() CopyDirectory(dir.FullName, Path.Combine(dest_info.FullName, dir.Name), recursive, overwrite, False) Next End If ' Copy all files in this directory. For Each file As FileInfo In source_info.GetFiles() file.CopyTo(Path.Combine(dest_info.FullName, file.Name), overwrite) Next Catch ex As Exception Return ex ' Return the exception error. End Try Return Nothing ' No errors. End Function Sub Main() ' Testing the code. Dim result As Exception = StaticMethods.CopyDirectory("C:\Users\Admin\Desktop\Chess", "C:\Users\Admin\Desktop\Copy\Chess", True, True) If Not result Is Nothing Then Console.Write(result.ToString()) Console.ReadKey() End If End Sub End Module[/quote] All it requires to work is CopyDirectory(source, destination). The other arguments are optional.


    Alternatively, you could do...
    Code: My.Computer.FileSystem.CopyDirectory(folder, newlocation, True)[/quote] ...that is effectively the same as...
    Code: CopyDirectory(folder, newlocation)[/quote] ...but I'm pretty sure My.Computer is a VB only thing so it's a bad habit to get into using that.
     
    FordGT90Concept, May 20, 2019
    #2
  3. Directory Size Utility

    Thanks buddy! Yea, this section's not dead. Kreij and I have big plans for this section. I don't want to give nothing away, but we have some bigger projects down the road. *Toast :toast: I feel I'm pretty good at coding with different languages, but I'm well behind Kreij's level of experience with those other Languages. I've been working on those other languages, and soon I'll feel comfortable enough to start, and not feel like I'm holding the project back. *Toast :toast:

    Now on to your suggestions.

    • maybe you rename Get Folder button caption to something more intuitive? Add Folder, Get Folder Size, Check Folder Size or something like that? Yea, that's been bothering me and I like your suggestion "Add Folder". I'll change it on the next release.
    • Could you add subfolder files to the right pane? (it can be a tickbox with include sub dirs) I could add this, but let me see if I understand what you're asking. By subfolders you mean add all the folders in the left panel to the right panel? Those folders are all the subfolders in the "Get folder".
    • maybe you also add export list to excel? I'll add this on the next release.
    • there's delete file button maybe you add delete folder button too? I'll add this on the next release.
    • and finally maybe you can add UP button for directories? I'll add this on the next release.
    These are all great suggestions! Thanks Drone! *Toast :toast:
     
    Mindweaver, May 20, 2019
    #3
  4. How to copy 1st level directories C:\ as source using xxcopy

    How many directory levels does Windows 10 support?

    Rsyncing Linux directories and files to Windows. Errors on a number of directories that have > 13 levels from C:\

    What is the limit for directory (folder) levels in Windows 10? Is there a way to configure so that I can have more directory tree levels?
     
    SomeOneBesidesYou, May 20, 2019
    #4
Thema:

How to copy 1st level directories C:\ as source using xxcopy

Loading...
  1. How to copy 1st level directories C:\ as source using xxcopy - Similar Threads - copy 1st level

  2. Robocopy automatically taking source directory as the script file directory

    in Windows 10 Network and Sharing
    Robocopy automatically taking source directory as the script file directory: Synopsis:- Script file directory name -> PowerShellScripts in Desktop in local C:\...- Script file name -> Dbackup.ps1- Intended source for mirroring -> D:\ a partition on local hard disk- Intended destination for mirroring -> F:\D_LAPTOP_BACKUP_ ... F: is external SSD...
  3. Robocopy automatically taking source directory as the script file directory

    in Windows 10 Gaming
    Robocopy automatically taking source directory as the script file directory: Synopsis:- Script file directory name -> PowerShellScripts in Desktop in local C:\...- Script file name -> Dbackup.ps1- Intended source for mirroring -> D:\ a partition on local hard disk- Intended destination for mirroring -> F:\D_LAPTOP_BACKUP_ ... F: is external SSD...
  4. Robocopy automatically taking source directory as the script file directory

    in Windows 10 Software and Apps
    Robocopy automatically taking source directory as the script file directory: Synopsis:- Script file directory name -> PowerShellScripts in Desktop in local C:\...- Script file name -> Dbackup.ps1- Intended source for mirroring -> D:\ a partition on local hard disk- Intended destination for mirroring -> F:\D_LAPTOP_BACKUP_ ... F: is external SSD...
  5. How to copy definition of ODBC Data Sources easily?

    in Windows 10 Network and Sharing
    How to copy definition of ODBC Data Sources easily?: I have defined 8 "ODBC Data Sources 32-bit" on a Windows10 64 bit.I use them in a machine user interface and every time I create a new user interface I have to define these ODBC data sources from scratch. It is not complicated, but it is tedious and there is the risk of...
  6. Open source tool for directory statistics

    in Windows 10 Ask Insider
    Open source tool for directory statistics: Can anyone suggest a good open source alternative for WinDirStat? I am not having access to install any software, so this should work as a standalone application. submitted by /u/pradpee [link] [comments]...
  7. Scripting error using Batchrun + XXCopy

    in Windows 10 Support
    Scripting error using Batchrun + XXCopy: I have used both Batchrun and XXCopy for years - I use scripts I have made with them every day. Recently started using Windows 10 and have a problem. Anyone with scripting know-how able to advise please? I can write a batch file (.bat) which will run just fine. However, if I...
  8. C:\Users Directory

    in Windows 10 Network and Sharing
    C:\Users Directory: Good Afternoon, I have a machine that is a member of a domain. The user account logged onto the machine is a user not an administrator. I run a portable program requires no prior installation as an administrator. I enter domain admin credentials. These domain...
  9. C:\users directory?

    in Windows 10 Customization
    C:\users directory?: My C:\users directory shows up as C:\Public\US SEAL 7.ico. Anyone know what's up with that? Thanks; https://answers.microsoft.com/en-us/windows/forum/all/cusers-directory/e798521b-7dab-4ae0-89f6-ade14e8fc0e7
  10. Xcopy syntax for multiple source directories

    in Windows 10 Support
    Xcopy syntax for multiple source directories: can someone show me a sample xcopy command to copy C:\Directory1 and C:\Directory2 to a destination directory H:\DestinationDirectory? 88324