Writing code inside sudo.exec in Electron App
问题 I need to execute code with admin rights at many places. I find sudo.exe and successfully prompt user for permission and password. I still could not figure out how exactly to use sudo.exe. As I am getting same error of permission denied while deleting a file that need admin permission. That is how my code looks like: const fs = require('fs') var sudo = require('sudo-prompt'); var options = { name: 'Electron', }; sudo.exec('echo hello', options, function(error, stdout, stderr) { if (error)