# win-sudo

> Sudo equivalent for Windows

Latest version **0.1.0** (published 2020-01-27) · 0 weekly downloads

## Install

```sh
npm install win-sudo
pnpm add win-sudo
yarn add win-sudo
bun add win-sudo
```

Provides the commands `sudo`, `win-sudo`.

## Health

**Score 0/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-01-27 |
| First published | 2020-01-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | laggingreflex |

## Links

- npm: https://www.npmjs.com/package/win-sudo
- Repository: https://github.com/laggingreflex/win-sudo
- Homepage: https://github.com/laggingreflex/win-sudo#readme
- Issues: https://github.com/laggingreflex/win-sudo/issues
- npm.io page: https://npm.io/package/win-sudo

## Dependencies (3)

- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [class-cli](https://npm.io/package/class-cli.md) ^0.3.1
- [read-until-deleted](https://npm.io/package/read-until-deleted.md) github:laggingreflex/read-until-deleted

## Recent versions

- 0.1.0 (latest) — 2020-01-27

## README

# win-sudo

Uses [Task Scheduler] to run any command as administrator on Windows.

**Note**: See [caveats](#caveats) for associated **risks**.

## Install

```
npm i -g win-sudo
```

## Usage

First time: Register from an elevated prompt:

```
sudo $register
```

This will create a new [Scheduled Task][Task Scheduler] "win-sudo" with HIGHEST Run Level.

Subsequently, from any (un-elevated) prompt:

```
sudo command-you-want-to-run with args
```

This will run the task "win-sudo" which will run the specified command.

## Caveats

* **DANGER**: **It will \*never\* ask for a \*password\***. Any program/command will be able to use this feature to carry out commands with elevated privileges.

* It stores the command that needs to be run temporarily in a lockfile. So some use-cases may not be ideal for this (like running a lot of parallel commands at once).

* It stores and relays input/output from the task to current prompt via (unique) temporary files.

* It's not perfect. Issues/PRs most welcome.

[Task Scheduler]: https://en.wikipedia.org/wiki/Windows_Task_Scheduler

---
_Source: https://npm.io/package/win-sudo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
