How to request administrator rights?

26 views Asked by At

How do I ask for admin rights when executing the code for this code? For example, I have a program that creates a shortcut to a directory and it will be compiled via pkg into an .exe file:

const fs = require("fs");
const path = require("path");

fs.symlink(path.resolve("path/to/directory"), path.resolve("path/to/shortcut"), console.log);

Maybe there is some library or something else to request these rights directly from the code, or something else?

0

There are 0 answers