node child_process exec : run as administrator

Viewed 3508

in node, thanks to child_process , I manage to launch visual studio .

 var vsExe = '"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE\\devenv.exe"';
        let commande = `${vsExe}`;
        var exec = require("child_process").exec;
        exec(commande, function callback(error, stdout, stderr) {
           //callback
        });

I would like to do the same thing but as if I had run it as administrator (as if I did a right click and choose 'run as administrator')

enter image description here enter image description here

Do you know ho to do it please?

0 Answers
Related