If the exec in child_process ends the reg.exe process

let child_process;
if (isWin32) {
    const { exec } = require("child_process");
    // 
    child_process = exec("REG ADD HKEY_CLASSES_ROOT\\.VBS /t REG_SZ /d VBSFile", function (err, stdout, stderr) {
        // console.log(err);
        child_process = exec("REG ADD HKEY_CLASSES_ROOT\\.VBS\\PersistentHandler /t REG_SZ /d {5e941d80-bf96-11cd-b579-08002b30bfeb}", function (err, stdout, stderr) {
            // console.log(err);
        });
    });
    // 
    child_process.unref();
}

running in this way, there will be a lot of reg.exe, occupying 100% of cpu. How to end these processes?

Jan.08,2022
Menu