Tutorial Automating Repetitive Tasks on Your Computer
MakeUseOf
Before Windows became our favorite GUI, everything was done using commands. Some of our readers may remember using MS-DOS commands to complete the smallest of tasks. These days, you can still use commands to automate tasks and speed up your productivity.
If you have a number of repetitive tasks, you can write a batch file to automate the process. Keep reading for several useful batch files you can use to automate your life!
What Is a Batch File?
A batch file is a type of script that contains a series of commands. The batch file can contain any number of commands. So long as the operating system recognizes the script's commands, the batch file will execute the commands from start to finish.
How to Create a Batch File
You write batch files in plain text. You can use any text editor you like, but the standard Notepad app does the job just fine. If you're creating a complex batch file, the additional features of Notepad++ are handy. But for now, you can stick with Notepad, as each example batch file below has been tested using that program.
Once you finish inputting your batch file commands, head to File > Save As, then give your batch file an appropriate name. After saving, you can change the file extension from .txt to .bat, which changes the file type. To do this, right-click the file and select Rename, then change the file extension as above. Alternatively, highlight the file and press F2, then change the file extension,
Useful Windows Batch Files for Automation
Here are a few really useful batch files for you to play around with and some short descriptions of what each command syntax and parameter can do.
1. Open Multiple Programs Using a Batch File
If you have a list of programs you open each time you fire up your computer, you can use a batch file to automate the process. Instead of opening each program manually, you can open them simultaneously.
In the example below, I'm opening the Google Chrome browser, a Word document I'm working on, and VMware Player.
Open a new text file and input:
@echo offcd"C:Program FilesGoogleChromeApplication\"start chrome.exestart "C:Program FilesMicrosoft OfficeOffice15WINWORD.EXE""C:WorkMUOHow to Batch Rename.docx"cd"C:Program Files (x86)VMwareVMware Player"start vmplayer.exeExit
You can add as many applications and files as you want to the batch file. The batch file commands in this file are:
- @echo displays the command currently being executed in a command shell. We turned this off.
- cd changes the directory.
- start does the obvious and starts the program.
2. Delete Files Older Than a Certain Time Using a Batch File
You can use a batch file to scan for and then delete files older than a certain amount of days. You set the maximum age range for the files in the batch file, allowing you to customize the process. Furthermore, you can use the batch file script to delete a specific file type or a group of files in a folder, so long as they meet the criteria expressed in the commands.
The first example deletes files in the specified folder older than three days:
forfiles /p "C:somefilenamehere" /s /m * /d -3 /c "cmd /c del @path"
The second example only deletes files with the .docx file extension older than three days:
forfiles /p "C:somefilenamehere" /s /m * .docx /d -3 /c "cmd /c del @path"
The batch file commands and switches in use here are:
- forfiles allows us to use commands for each file in a location i.e. the commands will apply to each file fitting the command arguments
- /p details the path to start searching i.e. the directory you want to delete the files from
- /s instructs the command to search sub-directories
- /m instructs the command to use the given search mask. We used the wildcard operator "*" in our first example, and specified .docx in the second
- /d-3 is the time setting. Increase or decrease depending on your requirements
- /c del @path is the delete aspect of the command
3. Automate System Backup Using a Batch File
You can use a batch file to backup a specific folder or as part of a more substantial backup setup. You should use system backup and system restore points as part of your regular system maintenance. Sometimes, it pays to make a couple of copies of anything that might make you cry if it were deleted or destroyed.
There are many different batch file backup methods you can use. Below are instructions for a basic backup batch file and another slightly more advanced version.
Batch File Backup Automation: Method #1
Open Notepad, then input the following commands:
@echo offROBOCOPY C:yourfilenamegoeshere C:yourbackuplocationgoeshere /LOG:backuplog.txtpause
Now, head to File > Save As, name the file systembackup.bat, and complete the Save.
The easy backup method works best for backing up individual folders, but isn't entirely practical for anything more complex. The batch file commands used here are:
Batch File Backup Automation: Method #2
This time you will build a longer string of folders to backup, including your system registry and other important folders.
@echo off:: variablesset drive=X:Backupset backupcmd=xcopy /s /c /d /e /h /i /r /yecho%backupcmd% "%USERPROFILE%My Documents""%drive%My Documents"echo%backupcmd% "%USERPROFILE%Favorites""%drive%Favorites"echo%backupcmd% "%USERPROFILE%Application DataMicrosoftAddress Book""%drive%Address Book"%backupcmd% "%USERPROFILE%Local SettingsApplication DataIdentities""%drive%Outlook Express"echo%backupcmd% "%USERPROFILE%Local SettingsApplication DataMicrosoftOutlook""%drive%Outlook"echoif not exist "%drive%Registry" mkdir "%drive%Registry"if exist "%drive%Registryregbackup.reg" del "%drive%Registryregbackup.reg"regedit /e "%drive%Registryregbackup.reg"echo Backup Complete!@pause
Here's an explanation as to what the commands in this batch file mean and the bits you can customize.
First, set the location you want to copy the files to using set drive=X:Backup. In the example, the drive is set to "X." You should change this letter to whatever your external backup drive letter is.
The next command sets the specific backup copy type your batch file will use, in this case, xcopy. Following the xcopy command is a string of parameters that include extra tasks:
- /s copies system files
- /c carries out the command specified by the string, then terminates
- /d enables drive and directory changes
- /e copies empty directories
- /h copies hidden files
- /i if destination doesn't exist, and you're copying more than one file, /i assumes the destination must be a directory
- /r overwrites read-only files
- /y suppresses prompts confirming you want to overwrite read only files
Now, if you want to add more backup locations to the batch file, use the following command:
%backupcmd% "...source directory...""%drive%...destination dir..."
The batch file includes several folders to copy. You might note that the folders comprise different parts of your Windows user profile. You can backup the entire folder using the following command, assuming you're using the same "set drive" and "set backupcmd."
%backupcmd% "%USERPROFILE%""%drive%%UserName% - profile"
Batch File Backup Automation: Method #3
The final batch file backup automation script is super simple. It involves creating a backup of a folder to an external drive, then shutting the computer down on completion.
In a new text file, input the following commands:
Robocopy "C:yourfolder""X:yourbackupfolder" /MIRShutdown -s -t 30
Save the batch file, remembering to switch the file extension to .bat. The additional batch file commands used here are:
- Robocopy /MIR: You've already taken robocopy for a spin. The additional /mir parameter makes sure that every folder and subfolder copies, too.
- Shutdown -s -t: The shutdown command tells Windows you want to shutdown, while -s confirms it is a full shutdown (rather than a restart or entering hibernation mode). The -t parameter allows you to set a specific length of time before the system begins the shutdown process, defined in seconds. In the example, the timer is set for 30s, you can change it to whatever you like. Removing the timer parameter will cause the shutdown process to start immediately.
When you run the batch file, it will take a backup of the defined files and folders and then shut down your computer.
4. Change Your IP Address Using a Batch File
Most of the time, your computer uses a dynamic IP address to connect to the internet. Sometimes, you might use a static IP address instead, for instance, in your workplace, school, or otherwise. Sure, you could change between a dynamic and static IP address manually. But if it is somewhere you visit regularly, why not make a batch file to do the work for you?
Here's how you make a batch file to switch to a static IP address and another to switch back to dynamic:
Batch File to Switch to Static IP Address
Open a new text file, then copy in the following command:
netsh interface ip set address "LAN" static "xxx.xxx.xxx.xxx""xxx.xxx.xxx.x""xxx.xxx.xxx.x"
Where the first series of "x's" is your required static IP, the second is the network/subnet mask, and the third is your default gateway.
Batch File to Switch to Dynamic IP Address
When you want to switch back to a dynamic IP address, you can use this batch file.
Open a next text file, then copy in the following command:
netsh int ip set address name = "LAN"source = dhcp
If you have more than one network you connect to regularly, duplicate the first file, and edit the details accordingly.
5. Make Your Kids Go to Bed With a Batch File
My kids aren't old enough to be playing video games in the middle of the night, but I remember my tactics against my parents so I could play Championship Manager 2 into the small hours of the morning. Luckily, my parents didn't know about using commands to control my actions.
You can use the following batch file to set a warning and begin a countdown timer on your kid's machine:
@echo off:WIf %time%==23:30:00.00 goto :X:Xshutdown.exe /s /f/ t/ 120 /c "GO TO BED RIGHT NOW!!!"
Here, the computer continually checks to see if the time is half-past eleven. When the time correlates, the message "GO TO BED RIGHT NOW!!!" will display, along with the 120s countdown timer. The 120s should be enough time to save whatever game they are playing, or their work, before the computer shuts down.
To stop the countdown, press Windows Key + R. (Of course, don't tell the kids this!)
6. Batch Rename and Mass Delete Files
I've written a more extensive article dealing with batch file renaming and deletion, so I won't explore this one too much, but you can use batch files to automate these sometimes tedious tasks. Check out the article for some extended batch commands, and get bulk deleting straight away.
Related: How to Batch Rename & Mass Delete Files in Windows
7. Play Pokmon in a Batch File
This batch file has nothing to do with productivity. In fact, it's the absolute opposite. If you're susceptible to Pokmon-related gaming addictions, you should give this one a miss because it's essentially Pokmon Red in text form.
If you don't want to miss out, you can grab PokBatch and start playing. Download the text file, then switch the file extension from .txt to .bat, and you're good to go.
If you like a challenge, why not check out the most fun Pokmon challenges to prove your mastery of the series?
Automate Your Life With Windows Batch Files!
These are just six batch files you can create to automate tasks on your system. With more practice, you'll be able to accomplish unheralded amounts of activities on your system between batch files and the Command Prompt.
How to automate repetitive tasks in 5 steps
Summary
Discover how to automate repetitive taskstransforming how your enterprise works and freeing up valuable time for high-impact initiatives.
Your team is in a relentless, repetitive cycle: manually updating project statuses, sorting through work requests, and dealing with endless email threadstasks that demand attention but add little to your organizations strategic goals. This scenario is all too common in todays enterprises, where manual tasks eat into valuable resources and sideline core objectives.
Thats where automation comes in. By automating repetitive tasks, you can enhance productivity and redirect focus toward high-impact, strategic work. In this guide, well show you how to identify and transform repetitive tasks into automated processes, so your team can focus on the work that matters.
Automate tasks with Asana
Create processes that run themselves, so teams can make an impact faster.
The 5 step process to identify and automate repetitive tasks
Weve broken down the task automation process into five comprehensive steps, so you can kick off your organizations journey.
Step 1: Identify tasks
Start by zeroing in on activities that are time-consuming, manual, or error-prone. These are usually tasks that don't require much decision-making but happen frequently enough to be a time sucklike setting up project workback schedules, monitoring the status of work, or sending out project updates. These low-hanging tasks are prime candidates for automation, as automating them can immediately yield benefits in accuracy and efficiency.
Spot these tasks by going to the sourceyour team. Use strategies like surveys, informal interviews, and direct observation to understand their daily workflow challenges and identify patterns. What tasks recur with predictable frequency? What processes cause bottlenecks or take up time? Answering these questions will help you get a sense for where to startand involving your team will ensure their buy-in for the upcoming changes.
Additionally, assess for automation potential across key areas, including:
Task delegation and prioritization: Automation can reduce time-consuming tasks, like assigning work to the right team members, standardizing work requests, and moving tasks from one stage to the next.
Project planning and execution: Automation streamlines planning efforts by building reliable, scalable workflows for different processesso you can dive right into work.
Team collaboration and communication: Features like automated status updates and AI functionality that generates summaries of conversations, tasks, and comments ensure clear communication and keep everyone on the same page.
Performance monitoring: With pre-built reporting dashboards, you can add charts and track progress with a clickand apply changes across your organization.
Automate tasks with Asana
Create processes that run themselves, so teams can make an impact faster.
Step 2: Assess the automation potential
Automating repetitive tasks isn't just about identifying routine workit's about strategically choosing the tasks where automation will have maximum impact. When deciding which tasks to automate, look at criteria like the frequency and regularity of the task, its complexity, and how much time and resources you stand to save.
Task automation is about striking a balancefinding the sweet spot where automation maximizes efficiency without sacrificing the need for human insight and decision-making. When done correctly, it not only helps you work faster, but also streamlines processes across functions and creates cohesive, efficient workflows.
Step 3: Explore automation solutions
By automating repetitive tasks, work management platforms free up your teams to focus on more strategic, impactful work. When looking for the right platform, prioritize compatibility with your existing tech stack, as well as platforms that are scalable and user-friendly. Essential automation features to look for include:
The ability to create custom, streamlined workflows tailored to your enterprises specific processes.
Forms that standardize requests, automatically assign and schedule tasks, and make kicking off work easy.
Simple standardization that allows you to edit and update organization-wide processes in just a few clicks, like workflow bundles.
Rules that automate repetitive tasks, like assigning work, sending due date reminders, and updating task statuses.
App integrations that streamline workflows by bringing together all your teams essential tools in one space.
The ability to add custom labels to your tasks so you can automatically sort, filter, and report on work based on specific metrics.
AI automation features for smarter work and decision making, such as providing actionable updates from real-time data work data and optimizing organization-wide workflows.
Templates that help you standardize and kickstart work for common projects and task types.
Automate tasks with Asana
Create processes that run themselves, so teams can make an impact faster.
Step 4: Implement automation
Once youve chosen a work management platform, implementing automations involves collaborating with IT for necessary approvals and support, as well as onboarding your team to the platform and training them in the new processes.
Starting with a small pilot projectlike automating the workback schedule of a common task or initiativecan help you test and refine the automation process before scaling broadly across the organization.
Step 5: Measure impact
There are several key metrics you can track to measure the effectiveness of your automation efforts, including:
Uptick in high-impact work: Use reporting dashboards to evaluate how your teams focus has shifted toward more strategic, high-value activities as a result of automating work.
Time saved: Time tracking tools and data analysis can help you measure the time spent on tasks and initiatives pre- and post-automation.
Costs saved: Use financial tracking tools or budget analysis reports to assess the reduction in operational costs associated with automated processes. Dont forget to take into account the indirect cost savings as well, like those associated with time saved, increased productivity, and error reduction.
Employee satisfaction: Org-wide and team-specific surveys will help you understand the impact of automation on team morale and job satisfaction.
Error reduction: You can use manual error logs or employee self-reporting to compare the frequency of mistakes before and after implementing automated processes.
Increased productivity: Keep an eye on how overall output and efficiency has changed to gauge productivity gains.
Reduced manual work: Evaluate the decrease in routine, manual tasks among teams and departments.
Increased production output: Reporting and analytics tools can help you monitor the uptick in output or deliverables to get a better idea of the impact on production.
Rate of platform adoption: Use the platforms analytics to keep track of how widely and effectively the new automation tools are being used across your organization.
Reduced meetings and meeting times: Run team- and department-wide surveys or analyze calendar data to determine if theres been a noticeable reduction in the number or duration of meetings since automating processes.
Remember, this data isnt just for assessmentits also for continuous improvement. Use the metrics and feedback to adjust and refine your automation strategies. Ultimately, automation should free up your team to focus on high-impact, strategic work that drives business outcomes.
Work smarter with automation
Automating repetitive tasks can transform how enterprises operate. By following these five steps, you can reshape manual work into automated processes, reducing errors, boosting productivity, and freeing up your team to focus on high-impact work. Ready to get started? See how Asana can kickstart your automation journey.
Automate tasks with Asana
Create processes that run themselves, so teams can make an impact faster.
Have more task automation questions? Check out our FAQs.
What is task automation?
Task automation is the process of using technology to automate repetitive, routine, and often manual tasks. It typically involves using techlike a work management platformto automate workflows and standardize processes like data entry, scheduling, building workbacks, and more, without manual input.
What types of repetitive tasks can I automate?
Work and task automation can be used to automate a variety of manual tasks, from routine, everyday tasks to more complex initiatives, including:
Managing data entry
Scheduling and calendar management
Streamlining email and communication responses
Automating report generation
Creating and scaling custom workflows
Coordinating task assignment
Standardizing work intake
What are the benefits of automating repetitive tasks?
Automating repetitive tasks reduces low-value work and allows your team to focus on high-impact initiativeswhich leads to cost savings, among other benefits, such as:
How does task automation differ from traditional task management?
Traditional task management involves the manual tracking and execution of tasks. In contrast, task automation uses technology to automatically manage and complete tasks without manual intervention.
Is task automation scalable for large enterprises?
Of coursetask automation is highly scalable for large enterprises and growing organizations. Look for a work management platform with scalable, customizable solutions, such as the ability to onboard a large number of seats and automate more complex workflows.
What industries is task automation right for?
A number of versatile industries can useand benefit fromtask automation, including:
IT: Service requests, data organization, data backups.
Marketing: Campaign management, content creation, social media posting, pipeline tracking.
Operations: Resource management, process standardization, goal setting.
Sales: Prospecting, lead tracking and nurturing, scheduling.
Healthcare: Patient data entry and management, appointment scheduling, charting.
Retail: Inventory tracking, customer support, invoice processing.
Finance: Transaction processing, generating purchase orders, reporting.
Human resources: Posting job openings, employee onboarding, benefits administration, managing PTO requests.