之前用 hiddenDOSCommand 本机测试通过,但是换其他电脑有时会不能用...
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:\\"
) -- 复制整个文件夹到指定目录
只能用 MAXScript 完成了...
fn copydir dir n =
(
dir_array = GetDirectories (dir + "/*")
for d in dir_array do
(
join dir_array (GetDirectories (d + "/*"))
)
copy_files = #()
append dir_array (dir + "/")
for f in dir_array do
(
join copy_files (getFiles (f + "*"))
)
for c in copy_files do
(
dir_path = n + (replace (getFilenamePath c) 1 dir.count "")
makedir dir_path
copyfile c ( dir_path + (filenameFromPath c))
)
)-- 将目标目录中的所有文件拷贝到输出目录,如果已存在则不拷贝
先收集所有的子目录,然后逐个收集目录内的文件,再新建目标目录并拷贝文件.
可能方法比较笨...但是暂时能用.