views:

9

answers:

2

Hi I'm trying to use robocopy to copy a single file from my computer to another computer over the network. The file I'm going to copy is named setup.exe and the directory it rests in also has a directory called "setup". I only want to copy over the executable, so I tried applying a filter to the robocopy command at the end listing the filename. However, despite the filter, it ends up copying both the executable AND the directory. Apprently robocopy ignores the file extension???

Here is the format of my robocopy command:

robocopy c:\users\ben\desktop /E /Z \\BensRemote\c$\temp setup.exe

so the filter at the end should be preventing the setup directory from also being copied over but it isn't. What am I doing wrong? Is it the /E argument???

A: 

The /E argument is what causes the problem.

ben
A: 

Drop the /E.

/E will copy over subdirectories, including empty ones. The filter you're applying, 'setup.exe', only refers to files, not folders.

SAL