About MAXScript copying folders and content to other locations

Source: Internet
Author: User

Before using Hiddendoscommand native test pass, but other computer sometimes can not use ...

fn xcopy Oldfile newfile =(Newfilepath= NewFile +"\\"+getfilenamefile oldfile xcopy_cmd="xcopy/s/e/i/y"+ Oldfile +" "+ newfilepath--+"&&rd/s/q"+oldfile Hiddendoscommand (xcopy_cmd as string) Startpath:"c:\\") --Copy the entire folder to the specified directory

Can only be finished with MAXScript ...

fn copydir dir n =(Dir_array= GetDirectories (dir +"/*")     forDinchDir_array Do(Join Dir_array (GetDirectories (d+"/*")) Copy_files=# () Append Dir_array (dir+"/")     forFinchDir_array Do(Join Copy_files (GetFiles (f+"*"))    )     forCinchCopy_files Do(Dir_path= n + (replace (Getfilenamepath c)1Dir.count"") MakeDir Dir_path copyfile C (Dir_path+(Filenamefrompath C) )))--Copies all files in the target directory to the output directory, and does not copy if they already exist

Collect all subdirectories first, then collect the files in the directory one by one, then create a new target directory and copy the files.

Possible methods are more stupid ... But it can be used temporarily.

About MAXScript copying folders and content to other locations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.