How to copy files with reserved names?


  1. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
       #1

    How to copy files with reserved names?


    I use an encryption & password protection program with an export function that creates file names containing "CON.". No problem if I just want to export and import the files, but I cannot copy the exported files. An attempt results in an invalid handle error. I assume that is because CON is a reserved name in Windows. I can't do anything about the file names being created. A display of the folder properties shows 60,383 files, 117 folders. Obviously File Explorer has no trouble reading the nested directories - even with their reserved names. Is there any way I can copy this stuff?
      My Computer


  2. Posts : 93
    Windows 10
       #2

    Short of booting into another OS, you can enable the Linux subsystem for Windows and use Bash, but it’s CLI not GUI. If you regularly find yourself in the need to copy from this folder though you might want to do this and setup a shell script.
      My Computer


  3. Posts : 5,478
    2004
       #3

    You can also use unlocker to rename or move files with restricted names (but not copy them).

    According to here you should be able to use the //?/ syntax but while you can create files with restricted names you can't then rename or delete them. Not sure if it is a bug or not.

    Code:
    PS C:\Windows\system32> new-item \\?\C:\temp\con.txt -type file
    
    
        Directory: \\?\C:\temp
    
    
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    -a----        21-May-17     13:00              0 con.txt
    
    
    PS C:\Windows\system32> rename-item \\?\C:\temp\con.txt newname.txt
    rename-item : Cannot rename because item at '\\?\C:\temp\con.txt' does not exist.
    At line:1 char:1
    + rename-item \\?\C:\temp\con.txt newname.txt
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Rename-Item], PSInvalidOperationException
        + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.RenameItemCommand
    
    PS C:\Windows\system32>
      My Computer


  4. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
    Thread Starter
       #4

    lx07 said:
    You can also use unlocker to rename or move files with restricted names (but not copy them).
    I hadn't used Unlocker for about 4 years and forgot (or maybe never knew) it could move and delete files with reserved names. This didn't provide me with a solution for the questions I asked, but it provided a solution to a more important question: If I find an alternative to the encryption and password protection program I'm using, how do I get rid of all those files with reserved names?

    Since you provided me with that solution, and since VeraCrypt does everything I need from the other program does, and since VeraCrypt seems to be supported while the other program (Everstrike's Protect Folder) seems to not be supported, I've switched. I no longer need the "export" folder full of reserved names so I deleted it.

    In the process of deleting the files I discovered that Unlocker has problem. While deleting those 60,000 files with reserved names, programs with multiple windows - some programs using .NET to manage multiple displays, for example - could not have their windows closed, moved, resized, etc. I have no idea what the interaction is, but it happened on 2 PCs so I don't think it was a fluke.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:48.
Find Us




Windows 10 Forums