- Batch Script Tutorial
- Batch Script - Home
- Batch Script - Overview
- Batch Script - Environment
- Batch Script - Commands
- Batch Script - Files
- Batch Script - Syntax
- Batch Script - Variables
- Batch Script - Comments
- Batch Script - Strings
- Batch Script - Arrays
- Batch Script - Decision Making
- Batch Script - Operators
- Batch Script - DATE & TIME
- Batch Script - Input / Output
- Batch Script - Return Code
- Batch Script - Functions
- Batch Script - Process
- Batch Script - Aliases
- Batch Script - Devices
- Batch Script - Registry
- Batch Script - Network
- Batch Script - Printing
- Batch Script - Debugging
- Batch Script - Logging
- Batch Script Resources
- Batch Script - Quick Guide
- Batch Script - Useful Resources
- Batch Script - Discussion
Batch Script - Renaming Files
For renaming files, Batch Script provides the REN or RENAME command.
Syntax
RENAME [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]
Let’s take a look at some examples of renaming files.
Examples
rename *.txt *.bak
The above command will rename all text files to files with .bak extension.
rename "TESTA.txt" "TESTB.txt"
The above command will rename the file TESTA.txt to TESTB.txt.
batch_script_functions.htm
Advertisements