# Check an admin script or command before running it

Explains what an unfamiliar script or command will actually do, flags risky lines, and suggests a safer way to run it.

- Topic: Software Development
- Framework: RTF
- Level: Standard
- Tags: Writing, Analyze, Plan, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/check-an-admin-script-or-command-before-running-it

## Prompt

```text
Explain this script or command before I run it, and flag anything risky.

**Script or command:** [PASTE]
**Where I got it:** [vendor docs / forum / colleague / AI-generated / unknown]
**Where I plan to run it:** [e.g. "domain controller", "100 laptops via Intune", "production Linux server"]
**Permissions it will run with:** [admin / root / standard user / service account]
**What I want it to do:** [MY GOAL]

Review:
1. Plain-language walkthrough: what each section does, in order.
2. Does it do what I want? Note any gap between my goal and the actual behavior.
3. Risky actions: deletions, recursive changes, registry or system file edits, disabling security tools, network downloads, encoded or obfuscated content, credential handling, outbound connections, persistence (scheduled tasks, services).
4. Hidden assumptions: hard-coded paths, OS versions, missing error handling, behavior if a variable is empty.
5. Red flags that suggest malicious intent, explained without guessing.

Then suggest:
- A safer version: dry-run or what-if mode, logging, confirmation prompts, scoping to a test group first.
- How to test it: on one non-critical machine or a snapshot, and what to check after.
- A rollback approach.

Return: a risk rating (low/medium/high), the walkthrough, a table of risky lines (Line | What it does | Risk | Fix), and the safer version with comments. If something is ambiguous, say so rather than assume it is safe.
```

## What to fill in

- PASTE
- vendor docs / forum / colleague / AI-generated / unknown
- admin / root / standard user / service account
- MY GOAL

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
