Table of Contents
In this article we will show you how to Backup using Batch Files. People who have grown up with high-tech Mac and Windows computers may not know this, but command-line interfaces were once used to control all personal computers. Yes, that awkward command box on your Windows computer was the only way most people ever used a computer.
Command line interfaces relied heavily on small programs called “scripts,” which were collections of operating system commands used to do common tasks. Even though today’s PCs have graphical user interfaces that are much smarter and easier to use than the old command lines, there are still times when the old way of controlling your computer is useful.
One of the most common uses of a command line script that works well is to back up data. Command line scripts can be set up to run automatically at any time without any help from a person, and they don’t have many restrictions. You can also go to the official Microsoft support site to know more information.
Ways to Backup using Batch Files
Create batch file to backup files in Windows
- Open Notepad. You could search it on taskbar, or right-click on the desktop, choose New > Text Document to create a new text file.
- Now you can type the backup script. If you want any text to be displayed after the operation is completed, enter the following lines:
@ECHO OFF
ECHO [Any text you want]
PAUSE
- Click File > Save As, give it a name and change the extension into .bat.
- Then you can double-click the script file to have a try.
Create auto backup batch file with Task Scheduler
- Open Control Panel, view it by large icons or small icons, then choose Administrative Tools > Task Scheduler. Then you can Create Basic Task.
- Type a task name and description, then choose how to trigger the task. Frequency and event are both available.
- Choose Start a program and browse your PC to select the .bat file.
- After confirmation, click Finish to create the schedule task. You should be able to find it in the Task Scheduler Library afterward.
FAQ
How do I backup files using Command Prompt?
Type Notepad.exe into the Command Prompt and press the Enter key to open the Notepad program. After starting the program, click File > Save As to open the Save As dialog. Right-click on the files or folders you want to back up and choose “Send to” your USB drive.
What is the best use of batch file?
A batch file is a script file that holds commands that need to be run one after the other. It helps automate tasks that don’t need input or action from the user. Batch files are often used to load programs, run multiple processes, or do a series of actions that are done over and over in the system.
What is the difference between batch file and command file?
The latest version of Microsoft language is in CMD files, while the older version is in BAT files. CMD works with older versions of Windows, but BAT does not. Most command.com scripts use CMD, but BAT won’t run in command.com scripts by itself unless it is told to.