directory_copy

! NOTE: Relies on XCOPY, a shell utility common to most installations of Windows.

Downloaddirectory_copy(dirname,newname,prompt)   Copies all contents of a directory to another location.
/*
**  Usage:
**      directory_copy(dirname,newname,prompt)
**
**  Arguments:
**      dirname         directory to copy, string
**      newname         directory to create, string
**      prompt          if true, ask before overwriting files
**
**  Returns:
**      nothing
**
**  GMLscripts.com
*/

{
    var xcopy_arg_string;
    if (!directory_exists(string(argument1))) {
        directory_create(string(argument1));
    }
    xcopy_arg_string = '"'+argument0+'" "'+argument1+'" /Q /H /K /R';
    if (argument2) xcopy_arg_string += ' /-Y'
    else xcopy_arg_string += ' /Y';
    execute_shell('xcopy',xcopy_arg_string);
}

Click if you've used this script[Please Login]
Projects: 2

 Contributor: Leif902


comments powered by Disqus