Open Command Prompt as Administrator and Plan Admin-Only Setup Steps in Cursor

Get the ways to open Command Prompt as administrator on your Windows version, plus a repo-based list of which setup commands need elevation, with verify and undo.

Agent prompt for Claude Code and GitHub Copilot

You get: How to open Command Prompt as administrator, admin-only steps and steps for Cursor's normal terminal

The prompt

Prompt
You are a Windows developer-environment engineer working inside Cursor. Task:  on . Tell me how to open an elevated (administrator) Command Prompt and exactly which steps need it.

Rules:
1. Inspect the repository first (README, setup scripts, package files, .env.example, Docker files) and cite the file each step comes from.
2. Do not run any command that needs administrator rights yourself; list it for me to run in an admin Command Prompt. Never commit, push or deploy.
3. Never invent command flags, package IDs, service names or config keys. For winget packages, show the winget search command as the source of the ID. When behavior depends on the installed version, write "check in your version".
4. Mark a step admin-only only if it changes system-wide state (services, Program Files, HKLM registry, hosts file, system PATH, firewall). Offer a per-user alternative when one exists.
5. Every admin command gets a verify command and an undo command.
6. If no steps need admin, say so plainly.

Output format:
1. How to open Command Prompt as administrator: 3 ways for my Windows version, plus how to confirm the window is elevated.
2. Admin-only steps: table with columns Step | Command | Why admin | Verify | Undo.
3. Steps for Cursor's normal terminal: numbered list.
4. Risks.

Finish with the assumptions you made and anything missing from the repo.

Example output

Example for: setup_task = set up local development for our Django + PostgreSQL repo on a new laptop, windows_version = Windows 11 Pro, standard user account, admin password available from IT; fictional repo harborbooks-api.

1. How to open Command Prompt as administrator
  1. Start menu: press the Windows key, type cmd, right-click Command Prompt, choose Run as administrator. On a standard account, UAC asks for the admin username and password.
  2. Keyboard: press the Windows key, type cmd, then press Ctrl+Shift+Enter.
  3. Terminal: press Win+X, choose Terminal (Admin), then open a Command Prompt tab from the tab dropdown.

Confirm elevation: the title bar starts with Administrator:. Run net session; if it prints "Access is denied", the window is not elevated.

2. Admin-only steps
StepCommandWhy adminVerifyUndo
Awinget install --id <ID from step 1 in section 3> -e (README.md: "PostgreSQL 16")Installs to Program Files and registers a Windows servicesc query state= all | findstr /i postgres. The service name depends on the installed version (for example postgresql-x64-16); note the exact name shownwinget uninstall --id <same ID>
Becho 127.0.0.1 harborbooks.local>> %SystemRoot%\System32\drivers\etc\hosts (README.md, "Local domain")The hosts file is system-protectedping -n 1 harborbooks.local replies from 127.0.0.1Open hosts in Notepad as admin and delete the line
3. Steps for Cursor's normal terminal
  1. winget search PostgreSQL and copy the ID for version 16 from the results; this is the ID for step A. Check in your version.
  2. py -3.12 -m venv .venv (pyproject.toml: requires-python = ">=3.12").
  3. .venv\Scripts\activate
  4. pip install -r requirements\dev.txt
  5. copy .env.example .env, then set DATABASE_URL with the password you chose during the PostgreSQL install.
  6. Add the PostgreSQL bin folder to your user PATH (Settings > Environment Variables for your account; no admin needed). The folder path depends on the installed version; check in your version.
  7. createdb -U postgres harborbooks
  8. python manage.py migrate, then python manage.py runserver.
4. Risks
  • Do not launch Cursor itself as administrator; the agent and every extension would then run elevated.
  • In step B, >> appends. A single > would overwrite the whole hosts file.
  • Company antivirus may block hosts edits; ask IT if step B fails in an elevated window.
  • .gitignore lists .env; keep the database password there, not in settings.py.

Assumptions and gaps: I assumed a native install because the repo has no docker-compose.yml. The repo has no script to create a dedicated database user, so step 7 uses the postgres superuser.

Written by AI from this prompt. Your results will vary.

How to use this prompt

  1. Open your project in Cursor and start an agent or chat session.
  2. Fill in {setup_task} and {windows_version}, then paste the prompt.
  3. Follow section 1 to open an elevated Command Prompt outside Cursor.
  4. Run admin steps there, run the rest in Cursor's terminal, and check each verify command before moving on.
Who it’s for:
Developers using Cursor on Windows who hit permission errors
What you get:
You know how to open and confirm an admin Command Prompt, and have a short, verified list of admin-only commands separated from normal ones.

Use cases

  • Setting up a Django and PostgreSQL repo on a new Windows 11 laptop with a standard user account
  • Fixing 'Access is denied' when a setup script edits the hosts file or installs a Windows service
  • Checking which README steps really need admin on a locked-down company laptop
  • Onboarding a junior developer who has never opened Command Prompt as administrator

Works well with

  • Cursor agent: reads README and setup scripts in the open repo before listing steps
  • Claude Code: inspects the repo itself and is good at separating admin from per-user steps

Try another example

The same prompt filled in for a different situation.

You are a Windows developer-environment engineer working inside Cursor. Task: fix 'Access is denied' when our setup.bat installs pnpm globally and opens port 5173 in the firewall on Windows 10 Enterprise, company-managed laptop, no local admin rights. Tell me how to open an elevated (administrator) Command Prompt and exactly which steps need it.

Rules:
1. Inspect the repository first (README, setup scripts, package files, .env.example, Docker files) and cite the file each step comes from.
2. Do not run any command that needs administrator rights yourself; list it for me to run in an admin Command Prompt. Never commit, push or deploy.
3. Never invent command flags, package IDs, service names or config keys. For winget packages, show the winget search command as the source of the ID. When behavior depends on the installed version, write "check in your version".
4. Mark a step admin-only only if it changes system-wide state (services, Program Files, HKLM registry, hosts file, system PATH, firewall). Offer a per-user alternative when one exists.
5. Every admin command gets a verify command and an undo command.
6. If no steps need admin, say so plainly.

Output format:
1. How to open Command Prompt as administrator: 3 ways for my Windows version, plus how to confirm the window is elevated.
2. Admin-only steps: table with columns Step | Command | Why admin | Verify | Undo.
3. Steps for Cursor's normal terminal: numbered list.
4. Risks.

Finish with the assumptions you made and anything missing from the repo.

Tips and common edits

Why this works

  • Section 1 puts the open-as-admin answer first, with a way to confirm elevation, so the common question is answered before any planning.
  • Limiting admin to system-wide changes and offering per-user options keeps elevated commands rare and deliberate.
  • Requiring search output as the source of package IDs and service names stops the agent from guessing names that differ by version.

Use in Cursor's agent or chat with your repo open when setup fails with 'Access is denied' or you need to know how to open an admin Command Prompt. Also works in Claude Code or Copilot.

Common edits

  • Swap Command Prompt for PowerShell if your scripts are .ps1 files, and ask for the PowerShell elevation check instead.
  • Add 'company-managed, no admin rights' to the Windows version so the agent focuses on per-user alternatives and what to request from IT.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

More in Cursor

Windows Command Prompt Steps to Recover a Corrupted or RAW USB Drive

Get an ordered, risk-labeled list of Windows Command Prompt steps to diagnose a failing USB drive and recover files before you change or format anything.

AI Coding AgentsClaude Code

Agent Session Handoff Brief with Resume Checklist and Verified State

Makes Claude Code produce a handoff file capturing goal, verified repo state, decisions, blockers, and exact resume commands so another engineer or agent session can continue without rework. Use it before ending a long task.

AI Coding AgentsClaude Code

Root-Cause Bug Fix With a Failing Test and a Minimal Patch

Get a reproduced bug, a regression test that fails before the fix and passes after it, the smallest patch and a log of the commands Claude Code actually ran.

Claude Code Hooks Not Working: Fix a Hook That Won't Fire

Returns a numbered diagnosis of your Claude Code hook (location, event, matcher, exit code, stdout, onFailure, path), the named cause, a corrected entry and a one-command test.

AI Coding AgentsClaude Code

Generate Reproducible Bug Fix Specs for Coding Agents

Get a standalone reproduction test script and a precise technical plan to fix a bug, ensuring your AI agent stays focused and avoids unnecessary file changes.

Cursor Call Graph Trace Before You Change a Function

Cursor maps who calls a function and what it calls, with file and line for every step, the callers your planned change could break and the exact tests to run, before any code is edited.