Search code examples
dossas

Copy All Files and Directories & Subdirectories in SAS


I used the follwoing statement to copy over files from one folder to another... but it does not copy over the subdirectory (and the files and folders under that subdirectory)

%sysExec copy "&driv.\&path1\*"  "&driv.\&path2";

Any Solutions?


Solution

  • Try this . . .

    %sysExec xcopy "&driv.\&path1\*.*"  "&driv.\&path2\*.*" /s;
    

    The /s option copies all subdirectories - provided they are not empty.