10

I 'm using the command copy in a build script to export apk files in a specific folder on the network and rename it by adding the release number as a suffix.

I tried giving the option -v but I'm getting the following error.

The system cannot find the file specified

if I use the command cp I get :

'cp' is not recognized as an internal or external command

Thanks in advance

1
  • Copy's /V is "Verify" not Verbose. What's the actual command you're trying to use when Copy with -v gives you that error? Are you remembering to delimit file paths that have spaces in them? If you don't use -v does it work as expected? Does the file you're trying to copy actually exist? – Ƭᴇcʜιᴇ007 Dec 13 '13 at 17:49
8

Try xcopy instead. Perhaps something like:

xcopy /F "C:\My Folder\file.txt" D:\

From xcopy /?:

/F - Displays full source and destination file names while copying.

2
  • I am amazed at how simmilar out answers are not only on technicals but format as well. – Frank Thomas Dec 13 '13 at 17:57
  • @FrankThomas, true. However techie typed slightly faster. – Synetech Dec 13 '13 at 18:58
5

try xcopy /f <source> <dest>

from the usage summary:

/F Displays full source and destination file names while copying.

can't get too much more verbose than that on a copy operation.

1
  • I was exactly looking to output the source and destination filenames, but it would be cool if I coud avoid displaying the entire file because it's a zipped package. – svassr Dec 13 '13 at 18:23
3

For a different answer... try robocopy.

xcopy has become deprecated (i.e. there are better and more supported tools) as of Windows Vista and up.

ROBOCOPY Source_folder Destination_folder /V

Where /V means:

/V : Produce Verbose output log, showing skipped files.

robocopy allows for more that that, as it can copy permissions, specific files and attributes and can even generate logs.

5
  • Does it work for a specific source file and destination file because I have to rename the file to suffix the version number by the way ? – svassr Dec 13 '13 at 21:18
  • I would assume so (see the embedded link for sample usage) but I rarely use Windows 7. – Doktoro Reichard Dec 13 '13 at 23:23
  • Indeed as an optional third argument you can specify a list of files using wildcard (eg ROBOCOPY C:\myProject\build\ C:\myProject\release\ *.apk. Bu I didn't find a way to rename the files in batch – svassr Dec 16 '13 at 16:33
  • You didn't mention anything about renaming in your question. However, you could do that with a FOR loop and/or the REN command. – Doktoro Reichard Dec 16 '13 at 17:43
  • You are right. My bad I thought I should edit my question to precise it but I forgot. – svassr Dec 16 '13 at 20:28
0

I use Robocopy for my batch scripts, but if you're looking for any Windows command, then you can always go for powershell: copy-item Source Destination -verbose

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.