/i: If Source is a directory or contains wildcards and Destination does not exist, xcopy assumes destination specifies a directory name and creates a new directory. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether Destination is a file or a directory. Jan 10, 2013 I am writing a batch file to copy all files ending in.log to another directory. The issue is that in the middle of the path, the folder name can be different. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether Destination is a file or a directory. /s: Copies directories and subdirectories, unless they are empty. If you omit /s, xcopy works within a single directory. /e: Copies all subdirectories, even if they are empty.

I am trying to write a batch file that will copy one file to several desktops in a directory. I've got this so far- xcopy c:windowsoutput.txt U:UsersWILDCARDDesktop In the wildcard section, we have usernames that are first initial last name and four digits. I would like to be able to just list the name and not the numbers, such as: xcopy c:windowsoutput. Srx600 Manual. txt U:UsersJSmith5624Desktop So it will copy to U:UsersJSmith5624Desktop but I would like to not have to know the numbers, but instead use a wildcard, so if the directory contains 'JSmith' it copies to that one. If I use a%, such as JSmith%, it makes a new directory- U:UsersJSmithDesktop instead of copying the file to U:UsersJsmith5624Desktop How can I use wildcards or maybe do an If/Then scenario, like IF directory contains 'jsmith' THEN copy the file.