Opened 8 years ago

Closed 4 years ago

#3152 closed Bug (No Bug)

FileCopy doesn't cope well with copying files with embedded spaces in their name to UNC destinations

Reported by: pscales@… Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


FileCopy of a file with a full path specification and included spaces in the filename to a destination specified as a UNC path will fail. Note that if no path specification is supplied in the source string, FileCopy succeeds. Tried with V,, beta

In the examples below, $temp is a folder name in the format "YYYYMMDDHHNNSS.$$$", e.g., "20151027144712.$$$"

FileCopy("C:\Temp\" & $temp & "\TestFile_1.txt", "\\SERVER\C$\Temp")

works, but

FileCopy("C:\Temp\" & $temp & "\Test File 2.txt", "\\SERVER\C$\Temp")


Neither does

FileCopy("""C:\Temp\" & $temp & "\Test File 2.txt""", "\\SERVER\C$\Temp")


FileCopy("""C:\Temp\" & $temp & "\Test File 2.txt""", """\\SERVER\C$\Temp""")

This works:

FileChangeDir("C:\Temp\" & $temp)
FileCopy("Test File 2.txt", "\\SERVER\C$\Temp")

Attachments (1)

FileCopyProblemCodeToReproduce.au3 (5.1 KB) - added by pscales@… 8 years ago.
AutoIt source code

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by pscales@…

AutoIt source code

comment:1 Changed 6 years ago by Jpm

  • Owner set to Jon
  • Status changed from new to assigned

comment:2 Changed 4 years ago by Jpm

The reproducing script is wrong as a "\" is missing for the "Test File 2.txt"
I don't have access to a remote server so I can't reproduce
Please try again with the script corrected

comment:3 Changed 4 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from assigned to closed

No bug just the repro script does not override the already copied file and mor the file name should not be protected

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jon.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.