- 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 - Moving Folders
For moving folders, Batch Script provides the MOVE command.
Syntax
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination
Following are the description of the options which can be presented to the DEL command.
S.No. | Options & Description |
---|---|
1. |
[drive:][path]filename1 Specifies the location and name of the file or files you want to move |
2. |
destination Specifies the new location of the file. Destination can consist of a drive letter and colon, a directory name, or a combination. If you are moving only one file, you can also include a filename if you want to rename the file when you move it. |
3. |
[drive:][path]dirname1 Specifies the directory you want to rename. |
4. |
dirname2 Specifies the new name of the directory. |
5. |
/Y Suppresses prompting to confirm you want to overwrite an existing destination file. |
6. |
/-Y Causes prompting to confirm you want to overwrite an existing destination file. |
Let’s look at some examples of moving folders.
Examples
move *.* C:\Example
The above command will move all files from the current directory to the folder C:\Example.
move *.txt C:\Example
The above command will move all files with the txt extension from the current directory to the folder C:\Example.
move C:\old\*.* C:\Example
The above command will move all files from the folder called ‘old’ in C drive to the folder C:\Example.