4~9: 執行壓縮指令,壓縮完畢跳到 code:11
11~17: 執行 xcopy 指令
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| var exec = require('child_process').exec,
child;
child = exec('"C:\\Program Files\\7-zip\\7zG.exe" a -r -mx9 "BackupLog.7z" "BackupLog.txt"', function(error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
exec('xcopy "BackupLog.7z" \\\\10.0.1.1\\test /y', function(error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
});
|