Recursively copying directory to Windows 7 nodes fails on files with tilde in name

I'm using Puppet V3.8, and trying to copy the installation files for some HP scanner software to some Windows nodes. However it is failing on two of the files, both of which have tilde (~) characters in the filenames (not at the beginning).

Here's the relevant output from puppet agent -t to show exactly what's happening:

[mError: ReplaceFile(c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/_8270H~1.cab, c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/_8270H~1.cab20161114-3620-ysybqc):  The process cannot access the file because it is being used by another process.
[mError: /Stage[main]/Printer::Scanner::Hp_scanjet_8270/File[c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/_8270H~1.cab]/ensure: change from absent to file failed: ReplaceFile(c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/_8270H~1.cab, c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/_8270H~1.cab20161114-3620-ysybqc):  The process cannot access the file because it is being used by another process.
[Error: ReplaceFile(c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/MergeM~1.cab, c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/MergeM~1.cab20161114-3620-1c59412):  The process cannot access the file because it is being used by another process.
[mError: /Stage[main]/Printer::Scanner::Hp_scanjet_8270/File[c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/MergeM~1.cab]/ensure: change from absent to file failed: ReplaceFile(c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/MergeM~1.cab, c:/PuppetFiles/apps/HPScanjet8270/setup/hpg8270/MergeM~1.cab20161114-3620-1c59412):  The process cannot access the file because it is being used by another process.
Here is the Puppet "command" that I'm using to do this:
    file { $localTargetDir: ensure => directory, source => 'puppet:///fs1-install/DRIVERS-SCANNERS/HPScanjet8270/', recurse => true, source_permissions => ignore, require => File[$localAppsDir ],

}


NOTE: I don't see why it would make a difference, but the fs1-install part of the path is a cifs mount from our linux file server.

All the other files work correctly, it's just these two with tilde in the name that have issues, hence my assumption that the tilde is the issue.

I would rename them, but I assume that would break the installation of the software.

Is there a way to work around this?

Update 1: I tried using ignore to exclude the tilde named files, and then using separate file definitions for each of them, but had the same outcome. No combination of backslashes, double or singles quotes that I tried helped either.

Update 2: I created a ticket for this https://tickets.puppetlabs.com/browse/PUP-6927

edit retag close merge delete