node-robocopy icon indicating copy to clipboard operation
node-robocopy copied to clipboard

A Javascript error occurred in the main process

Open hohnworld opened this issue 8 months ago • 1 comments

case 'copy': { // 问题:新目录隐藏 try { robocopy({ // Specifies the path to the source directory. // source: path.join(usb.disk + ':/', 'JW7135'), // source: path.join(usb.disk + ':', 'd'), // source: usb.disk + ':\JW7135\Movie', //会隐藏文件、文件夹 ,不能兼容不是这个目录的视频文件 source: usb.disk + ':', //会隐藏文件、文件夹 // Specifies the destination path(s). // destination: z:\\20240612\\${usb.cz + usb.name}, destination: usb.destPath, // files: '.mp4', files: ['.mp4', '.jpg', '.wav'], copy: { // Copies subdirectories. Note that this option excludes empty directories. [/s] subdirs: true, //子目录:非空的 moveFilesAndDirs: true, //移动:复制完删除源 // removeAttributes: 'RASHCNET' removeAttributes: 'SH' }, retry: { count: 0 //不重试:失败的时候 }, file: { excludeDirs: ['System Volume Information', '$RECYCLE.BIN'], excludeFiles: [ '未结束拷贝.日志', 'Time synchro(Pls Double Click Me).bat', 'Param.ini', 'BWC4G.ini' ] } }) .done(function () { const delPath = path.join(usb.disk + ':', '未结束拷贝.日志') exec(del ${delPath}, () => { exec(attrib -s -h ${usb.destPath}, () => { usb.progress = 1 //完成或报错 //移除: // removeUsb(usb) postTrackProgress(usb) }) }) }) .fail(function (error) { console.log(error.message) console.log('移动失败:' + error) }) } catch (e) { console.log('移动异常:' + e) }

Image

  }
  break

hohnworld avatar Aug 23 '25 08:08 hohnworld