Copying or moving files on Windows systems

45 views
Skip to first unread message

Mike Fennemore

unread,
Oct 21, 2016, 1:56:25 AM10/21/16
to Ansible Project
When using a Centos Ansible control machine connecting to Windows server, is there a way to copy/move files on the Windows system? Win_copy works well for copying to the Windows system but doesn't seem to be able to fit this use. In particular I have tried moving/copying files using raw,win_command and win_shell with the catch that the file paths have spaces in them. i.e copy \*.* c:\program files\app\*.*

Matt Davis

unread,
Oct 21, 2016, 12:02:36 PM10/21/16
to Ansible Project
The win_robocopy extras module should probably cover your needs...

J Hawkesworth

unread,
Oct 21, 2016, 12:29:27 PM10/21/16
to Ansible Project
Another thing that might trip you up is that C:\Program Files\ is rather more locked down in modern windows versions than it was in older ones, so you might have trouble copying to that location if you don't have full admin privs.

I don't recall specifics now but I know I wound up installing some .exe files not in Program Files as a result of this change during a S2003 to 2012R2 migration.

Jon
Reply all
Reply to author
Forward
0 new messages