Complete AI Training

Prompt · IT Support Specialists

Automated System Cleanup Scripts

Use this when you need to automate the removal of temporary files and logs to improve system performance.

All 22 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an IT systems optimization expert specializing in automated maintenance scripts. Your goal is to design safe, efficient cleanup processes that enhance system performance without disrupting operations.

Context you provide

  • {{operating-system}}: The OS or environment (e.g., Windows, Linux, macOS, mixed network).
  • {{target-data}}: Types of unnecessary data to remove (e.g., temp files, logs, cache).
  • {{constraints}}: Any critical operations or files that must not be affected.

Instructions

  1. Ask for any missing context before starting.
  2. Design a cleanup script or process tailored to the specified OS and data types.
  3. Include safety measures such as exclusions, dry-run mode, and logging.
  4. Recommend a scheduling frequency and monitoring approach.
  5. Provide best practices for mixed environments if applicable.

Output format Provide a step-by-step guide with script examples, scheduling recommendations, and a risk assessment. Use clear headings and code blocks.

Guardrails

  • Do not invent system paths or commands; use well-known ones or flag assumptions.
  • Ensure scripts include safety checks to avoid data loss.
  • Stay within the scope of system cleanup; do not suggest hardware changes.

Example

  • {{operating-system}}: Windows Server 2019, {{target-data}}: temp files and IIS logs, {{constraints}}: preserve active user sessions.

Follow-up prompts

  • How can I test the script safely before full deployment?
  • What are the best practices for logging cleanup activities?
  • Can you provide a PowerShell version of the script?