0

I have 3 partial files that I need to merge to just 1 zip. When using this PowerShell script:

copy /b v9_setup.1 + v9_setup.2 + v9_setup.3 v9_setup.zip

I get this error:

Copy-Item : A positional parameter cannot be found that accepts argument
'v9_setup.2'.
At line:1 char:1
+ copy /b v9_setup.1 v9_setup.2 v9_setup.3 v9_setup.zip
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Copy-Item], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

I am using Windows 10 Pro.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
user1287678
  • 73
  • 2
  • 11
  • 3
    In powershell copy is an alias for the copy-item cmdlet which doesn't understand the cmd.exe internal copy syntax. –  Jan 15 '17 at 21:48
  • 2
    Did you use PowerShell to initially separate the file into partial files? If so can you please edit your question to include this code? Usually it is best to use the same program or method to combine partial files. – Bluecakes Jan 15 '17 at 21:53
  • @LotPings Using copy-item gives the same error. Thanks. – user1287678 Jan 16 '17 at 00:27
  • @Bluecakes No, i did not separate the files. Thanks. – user1287678 Jan 16 '17 at 00:28
  • @user1287678 `copy` is the alias in powershell for `copy-item` LotPings is trying to say that you are trying to use the `copy` command from cmd rather than the `copy-item` cmdlet, because the `copy-item` cmdlet doesn't concatenate like `copy -b` does. Run your script in cmd and it should work. – BenH Jan 16 '17 at 01:38
  • You may be able to put the files together using PowerShell if they were simply separated by bytes. There are functions to split and combine in a related question: http://stackoverflow.com/questions/4533570/in-powershell-how-do-i-split-a-large-binary-file – Bluecakes Jan 16 '17 at 02:13

1 Answers1

0

As LotPings and user1287678 says, running the script in cmd.exe works. Thanks.

user1287678
  • 73
  • 2
  • 11