Windows 10: cdm won't copy directories with long names

Discus and support cdm won't copy directories with long names in Windows 10 Support to solve the problem; Hi. I am hoping someone knows a cmd string that will allow me to copy a desktop folder and its subfolders, or at least the files within, to an... Discussion in 'Windows 10 Support' started by tspnyc, Jan 12, 2019.

  1. tspnyc Win User

    cdm won't copy directories with long names


    Hi.

    I am hoping someone knows a cmd string that will allow me to copy a desktop folder and its subfolders, or at least the files within, to an external drive on a laptop that crashed with what looks like a bad mother board and it will no longer boot to Windows.


    I have two folders on my desktop that will not copy, due to "Too many parameters"

    I did not know about the issue with long directory names. In fact, I only taught myself basic DOS commands TODAY. I managed to get all my user documents, pictures etc. saved to external drives, and most of my desktop.

    Except for the two that say "Too many parameters"

    One is called "Media Temp" and the other is called "Martin strings video 2018"

    When I copy the entire desktop these two directories are left out.

    I assume it is because of the spaces and lengths of those names. When I try to copy them specifically I am told Invalid number of parameters.

    Both contain subfolders and the latter has multiple folders of videos I shot that exist nowhere else - *Sad

    Is there any way I can get these??


    I will add...

    When I copied the entire User directory, there is an icon for Desktop, but even with hidden files turned on I see only a few links of 1 or 2kb, but when I went to delete it, it was over 5 gigs and contained over 72 thousand items. But since I could not access them for some reason, I permanently deleted them.

    My Sager laptop won't boot to Windows (wheels spins once, then screen goes black, flashes and then the little light flickers next to the on light saying basically "can't talk to hard drive."

    Thanks

    :)
     
    tspnyc, Jan 12, 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, Jan 12, 2019
    #2
  3. The directory name is invalid

    Hi David,

    Since you have rebuilt your computer, it may have made some changes or installed some updates that might be causing the error message "G: \The directory name is invalid". However, let's check if there is a device that you can remove in Safely Remove Hardware
    utility. Follow these steps to access the utility:

    • Press the Windows icon + R on your keyboard.
    • Copy and paste this 'RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll".
    • Remove any device that you'll see in the utility.
    • Restart your computer, then observe if the issue will occur again.

    We're looking forward to your feedback.
     
    Carlos Tin, Jan 12, 2019
    #3
  4. jimbo45 Win User

    cdm won't copy directories with long names

    Cannot get Long Filenames / directory names to work


    Hi folks

    Anybody been able to get long file names / directory names to work

    Particularly annoying when downloading music. tagging and copying Music

    For example this downloaded from BBC R3 (classical music) -- LEGAL BTW !! works fine when I download on Linux server but Windows W10 Pro X-64 truncates target directory to ~ (the tilde sign) together with 8 seemingly random characters.

    Here's the source file name from BBC


    cdm won't copy directories with long names [​IMG]


    With large TB disk sizes now it's about time windows fixed the max directory + file length to Bigger than 255 chars.


    Cheers
    jimbo
     
    jimbo45, Jan 12, 2019
    #4
Thema:

cdm won't copy directories with long names

Loading...
  1. cdm won't copy directories with long names - Similar Threads - cdm won't copy

  2. the directory name is invalid

    in Windows 10 Gaming
    the directory name is invalid: after windows 10 install i get this message when i try to use my cd dvd playrt https://answers.microsoft.com/en-us/windows/forum/all/the-directory-name-is-invalid/c926c407-ebdd-4730-91de-be27bec8ff9e
  3. the directory name is invalid

    in Windows 10 Drivers and Hardware
    the directory name is invalid: after windows 10 install i get this message when i try to use my cd dvd playrt https://answers.microsoft.com/en-us/windows/forum/all/the-directory-name-is-invalid/c926c407-ebdd-4730-91de-be27bec8ff9e
  4. The Directory Name Is Invalid

    in Windows 10 Drivers and Hardware
    The Directory Name Is Invalid: Today I updated this laptop. Now all I see for the last 5 hours is this message: The directory name is invalid error message won't stop since I updated this PC from Windows 7 to Windows 10. What do I have to clear or change or reset to get this to stop showing up,...
  5. Directory name invaid

    in Windows 10 Network and Sharing
    Directory name invaid: I used a template in word, edited it and saved it gone to re open it now I get directory name invalided. do I need to redo the letter or can I open it some how? https://answers.microsoft.com/en-us/windows/forum/all/directory-name-invaid/8c316751-a28c-4d39-b738-44bd0387620f"
  6. Cannot get Long Filenames / directory names to work

    in Windows 10 Support
    Cannot get Long Filenames / directory names to work: Hi folks Anybody been able to get long file names / directory names to work Particularly annoying when downloading music. tagging and copying Music For example this downloaded from BBC R3 (classical music) -- LEGAL BTW !! works fine when I download on Linux server...
  7. Long file name problem: copied to external drive but can't copy back

    in Windows 10 Support
    Long file name problem: copied to external drive but can't copy back: I just finished replacing my motherboard/CPU and a few drives and re-installed Win10 in the process. I backed up the data on the drives to USB drives and had no issues. But now I can't copy the data off the external drive because of the "File name too long" error. I've...
  8. The Directory Name Is Invalid

    in Windows 10 Support
    The Directory Name Is Invalid: OK, here's my situation. I have a Western Digital (WD) My Passport Ultra external USB hard drive. I use this as a media drive on my WD TV Live Plus media player. For some unknown reason, the media player will sometimes corrupt files on the My Passport drive. The net effect is...
  9. directory name is invalid

    in Windows 10 Support
    directory name is invalid: Hi I have just got this new desktop pc. After an update I am getting this annoying message, E:/ The directory name is invalid. I don't know what I have done. I did anything. I searched Google and found a post on this forum but I can't find the actual answer to the post. Just...
  10. Long directory / file name support PLEASE Ms in a Windows update

    in Windows 10 Support
    Long directory / file name support PLEASE Ms in a Windows update: Hi there Please Ms can you fix the restriction of file + directory (folder) name length so they can be LONGER than approx 200 Chars For normal office type documents long file names won't be encountered very often but if you have large capacity HDD's with a lot of say...