Skip to main content
The rename command allows you to rename files inside an archive without extracting and recompressing.

Syntax

Parameters

string
required
Path to the archive file
string
required
Current name of the file in the archive
string
required
New name for the file

Basic Usage

Rename Single File

Rename Multiple Files

Examples

Rename with Path

Batch Rename

Important Notes

Archive Type LimitationsThe rename command is primarily supported for 7z archives. Other archive formats (ZIP, TAR) may have limited or no support for in-place renaming.
PerformanceRenaming files in solid archives may require recompression of the entire solid block, which can be slow for large archives.

Use Cases

Correct Filename Errors

Reorganize Archive Structure

Normalize File Extensions

Scripting Example

Advanced Usage

Rename with Pattern

Date-based Renaming

Error Handling

File Not Found

Name Conflicts

Limitations

Solid ArchivesRenaming files in solid 7z archives may be slow as it can require recompression of the solid block.
Encrypted ArchivesFor encrypted archives, you may need to provide the password:

Exit Codes

Alternatives

Extract, Rename, Recompress

For complex renaming or unsupported formats:

Best Practices

Always backup your archive before performing batch rename operations.
Test first with a copy of the archive to ensure your rename commands work as expected.
Use quotes around filenames with spaces or special characters:

See Also