Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CP Command Prompt Windows 7 not recognized

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?

like image 473
Satch3000 Avatar asked Feb 12 '14 16:02

Satch3000


People also ask

What is cp in cmd?

cp command copies files (or, optionally, directories). The copy is completely independent of the original. You can either copy one file to another, or copy arbitrarily many files to a destination directory. In the first format, when two file names are given, cp command copies SOURCE file to DEST file.

What to do if Command Prompt is not opening in Windows 7?

Type in cmd. In the drop down menu you will see cmd.exe. Right click on it and select run as administrator. If it fails there is some possibly corrupted files associated with it.


1 Answers

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).

like image 129
GabrielF Avatar answered Sep 16 '22 21:09

GabrielF