Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elevate NodeJS/Electron process on Windows

I'm currently building an app in Electron/NodeJS and am at a point where I'll need to elevate privileges on Windows to do a specific task (only Win7+ are a concern). How can I do this programmatically? I'll even take executing a bash script if it gets the job done. Thanks!

like image 387
Dustin Avatar asked Jul 23 '15 12:07

Dustin


People also ask

Can we run node js on Windows environment?

Node Version Manager, more commonly called nvm, is the most popular way to install multiple versions of Node. js, but is only available for Mac/Linux and not supported on Windows. Instead, we recommend installing nvm-windows and then using it to install Node.

Can I use node js in Electron?

Electron uses Chromium and Node. js so you can build your app with HTML, CSS, and JavaScript.

Do you need node to run Electron?

To use Electron, you need to install Node. js. We recommend that you use the latest LTS version available.


1 Answers

In order to UAC elevate, use the runas module: https://www.npmjs.com/package/runas

like image 151
Ana Betts Avatar answered Sep 24 '22 02:09

Ana Betts