CP Command Prompt Windows 7 not recognized

做~自己de王妃 提交于 2019-12-09 07:51:46

问题


I am trying to run the command CP at the command prompt on windows 7 but I'm getting:

'cp' is not recognized as an internal or external command, operable program or batch file.

Do I need to install any software to run cp command?

If so what?


回答1:


it is a unix/linux command. Download the cygwin package from cygwin.com




回答2:


By default, there's no cp in Windows Command Prompt (cmd.exe). The equivalent cmd.exe command is copy. cp is a Unix command.

If you can use PowerShell instead, which should come pre-installed in modern Windows systems, you can use cp and some other Unix commands directly in it.

If PowerShell isn't an alternative, you can use cp directly in Windows Command Prompt if you install Cygwin.

Moreover, Cygwin also includes the rsync command, which has many more features than cp, and might be preferable if you're not just copying a single file (e.g. for backup purposes).




回答3:


Necromancing.

There's a way to do run cp without cygwin and powershell and without admin rights.

Download the respective package (CoreUtils) from the Gnu-Win32 package repository.

You need the zipped binaries and the zipped dependencies. Unpack, and copy bin from deps to bin from coreutils.

Now add the bin folder to the path environment variable (system or user, depending on if you're admin or not), and open a new console. Type cp, and you'll see standard cp command output.



来源:https://stackoverflow.com/questions/21734377/cp-command-prompt-windows-7-not-recognized

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!