AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1536963
Accepted
mhck
mhck
Asked: 2020-03-30 11:53:48 +0800 CST2020-03-30 11:53:48 +0800 CST 2020-03-30 11:53:48 +0800 CST

Windows 10 复制命令错误

  • 772

我从命令提示符尝试了 Windows 10 复制命令,如下所示:

copy "c:\folderA" "d:\folderB"

这导致文件夹 B 是一个文件,而不是一个包含文件夹 A 内容的新文件夹。我有什么办法可以将文件夹B文件的内容提取回文件夹中?如果我在文本编辑器中打开 folderB 文件,文件中的第一件事是“SQLite 格式 3”。

如果发布了解决方案,请指出我的方向。我没有任何运气就寻找解决方案。

command-line copy
  • 3 3 个回答
  • 153 Views

3 个回答

  • Voted
  1. Best Answer
    harrymc
    2020-03-30T13:30:06+08:002020-03-30T13:30:06+08:00

    您的文件已连接,您可能需要使用文本编辑器编辑 folderB 文件,以手动将其分离到原始文件中。

    请注意,这仅在文件夹 A 包含文本文件而不是二进制文件时才有效。原因是默认选项copy是/A复制文本文件。复制二进制文件,需要指定参数/B.

    因此,如果文件夹 A 包含二进制文件,它们会被副本破坏或截断,因此无法挽救。

    • 3
  2. Pieter_Degroote
    2020-03-30T12:39:15+08:002020-03-30T12:39:15+08:00

    我可以复制预期目标位置导致包含源文件夹中所有文件的连接文件的情况(有点类似于 ZIP 文件,但里面有错误/错误的内容)。

    为了解决这个问题,我建议您将“d:\folderB”重命名为,例如,“d:\backup_concatenated”(出于备份原因......)。

    然后你可以重新开始使用:

    mkdir "d:\folderB"    
    copy "c:\folderA" "d:\folderB"
    

    这样,您将首先创建目标文件夹。其次,您可以将文件从“c:\folderA”复制到“d:\folderB”。

    请注意:此复制命令不会复制任何子文件夹,并且会跳过隐藏/系统文件。这样,它不能用于创建源文件夹的完整备份副本!

    为了让事情更方便一些,我更喜欢使用像“Total Commander”(或FAR Manager)这样的工具来完成这类工作......

    • 1
  3. Io-oI
    2020-03-30T13:18:49+08:002020-03-30T13:18:49+08:00

    对于文件夹,子文件夹的副本,是否包含文件,请使用xcopy命令copy...

    xcopy /e /v /c /i /q /g /h /r /k /y "c:\folderA" "d:\folderB"

    • 下面是xcopy /?命令帮助输出:
    Copies files and directory trees.
    
    XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                               [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
                               [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/J]
                               [/EXCLUDE:file1[+file2][+file3]...]
    
      source       Specifies the file(s) to copy.
      destination  Specifies the location and/or name of new files.
      /A           Copies only files with the archive attribute set,
                   doesn't change the attribute.
      /M           Copies only files with the archive attribute set,
                   turns off the archive attribute.
      /D:m-d-y     Copies files changed on or after the specified date.
                   If no date is given, copies only those files whose
                   source time is newer than the destination time.
      /EXCLUDE:file1[+file2][+file3]...
                   Specifies a list of files containing strings.  Each string
                   should be in a separate line in the files.  When any of the
                   strings match any part of the absolute path of the file to be
                   copied, that file will be excluded from being copied.  For
                   example, specifying a string like \obj\ or .obj will exclude
                   all files underneath the directory obj or all files with the
                   .obj extension respectively.
      /P           Prompts you before creating each destination file.
      /S           Copies directories and subdirectories except empty ones.
      /E           Copies directories and subdirectories, including empty ones.
                   Same as /S /E. May be used to modify /T.
      /V           Verifies the size of each new file.
      /W           Prompts you to press a key before copying.
      /C           Continues copying even if errors occur.
      /I           If destination does not exist and copying more than one file,
                   assumes that destination must be a directory.
      /Q           Does not display file names while copying.
      /F           Displays full source and destination file names while copying.
      /L           Displays files that would be copied.
      /G           Allows the copying of encrypted files to destination that does
                   not support encryption.
      /H           Copies hidden and system files also.
      /R           Overwrites read-only files.
      /T           Creates directory structure, but does not copy files. Does not
                   include empty directories or subdirectories. /T /E includes
                   empty directories and subdirectories.
      /U           Copies only files that already exist in destination.
      /K           Copies attributes. Normal Xcopy will reset read-only attributes.
      /N           Copies using the generated short names.
      /O           Copies file ownership and ACL information.
      /X           Copies file audit settings (implies /O).
      /Y           Suppresses prompting to confirm you want to overwrite an
                   existing destination file.
      /-Y          Causes prompting to confirm you want to overwrite an
                   existing destination file.
      /Z           Copies networked files in restartable mode.
      /B           Copies the Symbolic Link itself versus the target of the link.
      /J           Copies using unbuffered I/O. Recommended for very large files.
    
    The switch /Y may be preset in the COPYCMD environment variable.
    This may be overridden with /-Y on the command line.
    • 1

相关问题

  • 如何使用键盘快捷键在 macOS 终端中选择一行?

  • 如何在 macOS 的终端中切换切换(连续性)?

  • Windows 上是否有可以通过 CMD 或 Powershell 提供加密安全随机字节的设备或可执行文件?

  • Python 的“pass”参数的批处理等价物是什么?

  • 禁用后无法启用 Microsoft Print to PDF

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve