plus sign in file name
Moderator: DosItHelp
plus sign in file name
Copying some binaries from one directory to another utilizing 'copy' command, but facing issues when filename contain plus sign (in my case libstdc++-6.dll) and is not doublequoted. Probably the copy command misinterprete it as a file combining operation. Searching for any description about this issue, but found nothing... Is this a known issue?
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: plus sign in file name
Not a known issue per se, but a known and expected behavior. This is the very last sentence of copy /? -
Like all other special characters, you'll have to wrap the filename in quotes in order for the plus signs to behave like regular text.To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).
Re: plus sign in file name
I read this, but there is also list characters disallowed in filenames https://learn.microsoft.com/en-us/windo ... ing-a-file where plus sign is not listed. I wrote this article for another people who may facing this issue, and did not came to their mind the plus sign inde of filename automatically turn on file appending function unintendly.ShadowThief wrote: ↑12 Jun 2024 06:35Not a known issue per se, but a known and expected behavior. This is the very last sentence of copy /? -
Like all other special characters, you'll have to wrap the filename in quotes in order for the plus signs to behave like regular text.To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).
BTW: What about to extend this page https://ss64.com/nt/copy.html by notice "in case name some of your files could contain plus sign, enclose it with doublequotes" or something like this??
Re: plus sign in file name
Don't use COPY. Use XCOPY or ROBOCOPY.
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: plus sign in file name
Only the copy command will break with plus signs, whereas all commands break with those other listed characterslazna wrote: ↑12 Jun 2024 09:33I read this, but there is also list characters disallowed in filenames https://learn.microsoft.com/en-us/windo ... ing-a-file where plus sign is not listed. I wrote this article for another people who may facing this issue, and did not came to their mind the plus sign inde of filename automatically turn on file appending function unintendly.ShadowThief wrote: ↑12 Jun 2024 06:35Not a known issue per se, but a known and expected behavior. This is the very last sentence of copy /? -
Like all other special characters, you'll have to wrap the filename in quotes in order for the plus signs to behave like regular text.To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).
Nobody here controls that page, but you're welcome to post your suggestion on that site's forum. I don't know how likely the change will happen given that plus signs are clearly visible in the usage text indicating that they have special significance and the number one rule of interacting with any filenames is "put quotes around everything," but the owner is usually fairly open to recommendations.lazna wrote: ↑12 Jun 2024 09:33BTW: What about to extend this page https://ss64.com/nt/copy.html by notice "in case name some of your files could contain plus sign, enclose it with doublequotes" or something like this??