Windows CMD
    Files & Folders
    Caution
    Windows (cmd.exe)

    Rename a file in Windows CMD

    Renames a file or folder in place. The new name must be a name only, not a path — ren cannot move files.

    Template

    ren {old} {new}

    Complete example

    $ ren draft.txt final.txt

    Changes your system: it can install, move, restart or elevate. Check the target before you run it. Copying puts it on your clipboard — it runs on a real system only when you paste and press Enter there. The practice terminal is a simulator and never touches your machine.

    Where it runs

    Supported environments
    Windows (cmd.exe)
    Expected output
    Not documented yet on this page.
    Verification status
    Checked against official documentation — documentation reviewed on 2026-11-22. Syntax, options and requirements were reviewed against the linked official documentation. Not executed.
    Documentation link last checked on 2026-11-22 (reachable).
    Limitation: Documentation-only: this environment has no Windows, macOS, systemd, Docker, package-manager or network target to execute against safely.

    Parameter explorer

    Current name

    New name

    Template previewFill in the required values first
    $ ren {old} {new}

    Still a template — fill in {old}, {new}.

    Parameters

    old
    Current name
    new
    New name

    AI insights for this command

    Get a plain-English explanation, expected output, common errors + fixes, safer alternatives, and best practices — generated for this exact command.

    Free account — the reference below stays open to everyone.

    Same task in other shells

    Was this helpful?