I want to connect a computer by the full computer name on Remote Desktop Connection. In nodejs, i create a child process to execute a cmd command.It executed successfully,but after two minutes, it execute again. I use the kill method of child_process module,it doesn't work.
var child_process = require('child_process');
child_process.exec('mstsc /v ' + fullName, function(err, stdout, stderr) {
if(err){
console.log(err);
}
});
child_process.kill();
Can you help me? Thank you very much!
.kill()
too soon before your child_process has finished.exec()
so you aren't giving it a chance to run. – Weiweibelmstsc
normally runs and then terminates, then you should just let it do so without killing the process. The code you show here wouldn't run anything twice so if it is running twice, then it's because of some other code besides what you show here. – Weiweibel