Task automation tools on Windows 10
Did you realize that you regularly delete old files, clean up unnecessary data, launch some programs, etc. manually? If so, let Quantrimang help you automate these tasks.
Did you realize that you regularly delete old files, clean up unnecessary data, launch some programs, etc. manually? If so, let Quantrimang help you automate these tasks. First, the article will show you some Windows tools that automate certain tasks, and then some ways to automate some tasks on Windows 10.
Tools to automate Windows tasks
Its Command Prompt and batch file
Command Prompt, an MS-DOS Prompt successor, is a command line interpreter program. And a file has many of its commands called "batch files", which you can use to automate tasks, like backing up files or folders to a portable hard drive. To open it, just type cmd or Command Prompt in the search bar of the Start menu.
- 12 ways to open CMD - Command Prompt easily on Windows 10
You only need to compile the necessary commands in a text file with the '.bat' or '.cmd' extension. And you just need to open the file to run it; In this case, Windows 10 executes all the commands of the file sequentially or programmed in the batch file.
PowerShell and its script files
PowerShell is an automation and management framework built for users with system administration rights. If you're looking for automation, you need to learn and use PowerShell. Command Prompt is easier to learn and use than PowerShell because Powershell is powerful and offers more features.
- How are Command Prompt (cmd) and PowerShell different?
You can access Windows PowerShell by entering its name in the Start menu search box . Note, you will see two programs, 'PowerShell' and 'PowerShell ISE'. PowerShell is a command-line interpreter program like Command Prompt while the other program is used to write scripts (with the ".ps1" extension), containing a group of commands like batch files.
Task Scheduler and its task
Another automated Windows tool is Task Scheduler, a tool for scheduling programs and tasks. Scheduled tasks run at specific times, can display execution messages or when tasks are completed, etc. In addition, you can customize tasks to suit your requirements. mine.
- Windows tasks automate using Task Scheduler
If you want to access Task Scheduler in Windows 10, just type ' scheduler ' or ' Task Scheduler ' in Cortana 's search box. Note, even Windows and other installed programs (like Google Chrome) create scheduled tasks to perform their own maintenance activities, you should not modify or disable other tasks. .
- Automate maintenance tasks for Windows computers
You now know about the tools needed to automate tasks. If properly configured these scripts can automate various maintenance tasks on the computer without users checking or interfering with these operations.
Automation tasks
Launch multiple applications
If you want to automatically start multiple applications, programs, and files at the same time, you just need to create a batch file that identifies those programs. Alternatively, you can create a shortcut to this file and add a key combination to launch it quickly using the shortcut.
For example, you can create batch files to open specific folders, Google Chrome browser, Word files and Excel files using the code below. Note, " % USERPROFILE% " here refers to your user profile folder in Windows.
@
echo
off
:: Open folders
start %USERPROFILE%Documents
start %USERPROFILE%DesktopMusicFolder
:: Open files
start chrome.exe
start
""
"%USERPROFILE%DocumentsMy BlogsArticle1.docx"
start
""
"%USERPROFILE%DocumentsContent Ideas.xlsx"
exit
Start the application as an admin
To start the program as an admin you need to do it differently than above. That's because this program requires admin access by displaying the UAC prompt. If you do not approve the prompt, these programs will not start.
Using a shortcut placed in the Windows Startup folder does not work, so what to do? The Task Scheduler program will be the solution to this problem. It has only one option to run the program with administrative rights, so you can start one or more applications (using batch scripts) using Task Scheduler. Here's how:
- 5 IF commands help use Batch script smarter
Step 1: Open Task Scheduler > click " Create Task " in Actions in the right panel.
Step 2 : On the General tab, name the task as " NoUAC1 ", then select the " Run with highest rights " option.
Step 3 : Click on the Trigger tab, in the ' Begin the task ' section, select ' At startup '.
Step 4 : Now switch to the Actions tab, click New .
Step 5 : In the New Action window, in the Action select " Start a program ", in Program / script , click the Browse button, select the executable file you want to schedule and click OK .
Step 6 : Now, go to the Settings tab, select the option ' Allow task to be run on demand ' and then click OK to save.
Now the program (Adobe Reader in this tutorial) will automatically start with admin rights when booting the system.
- 3 ways to run the software using administrative rights in Windows
Delete all old files
If you are a technology enthusiast or developer, you often have to download and test many things. After a while, you'll see there are some unnecessary files "available" on your system because they take up space on your computer. There is a very good solution for this instead of having to manually delete that is to create a batch script to delete old download files.
Similarly, you can use batch files to delete all old files of specific extensions or files in a folder or sub-folder. To do this, you'll use the code below to delete the .docx file (change 'docx' to a file that suits you) in a specific folder with a time longer than twenty days (change the value of the option ' / d 'into any day).
@
echo
off
forfiles
/p
"%USERPROFILE%DocumentsMy Blogs"
/s
/m
*.docx
/d
-20
/c
"cmd /c del @path"
echo
Document files older than 20 days deleted
pause
exit
You can change the path (by changing the value of the " / p " option) to the directory containing the files to delete. Below, ' % USERPROFILE% ' means your user directory.
- How to schedule automatic file deletion in the folder Download Windows 10
Delete trash
You should delete the recycle bin regularly and although it is an easy task, users often forget it. Fortunately, you can automate this task using Task Scheduler. Here's how to free up free space on your hard drive:
- 5 Windows files and folders can be deleted to free up space
Step 1: Open Task Scheduler.
Step 2 : Open " Task Scheduler Library ", then in the Action menu, click on " New Folder " and name it " My Tasks ".
Step 3: Click on the ' My Tasks ' folder and select ' Create Task ' from the Action menu.
Step 4: In the Create Task window under the General tab, type the task name as " Empty Recycle Bin ".
Step 5 : Click on the Triggers tab, click New and in the ' Begin the task ' section, select ' On a schedule '.
Step 6 : Select Weekly or Monthly options to set the time to delete the file and click OK .
Step 7 : Click on the Actions tab, move to New and in the New Action window, in Settings , type " PowerShell.exe " in the Program / script section .
Step 8 : In the same window, in the " Add arguments (optional) " type -NoProfile -Command " Clear-RecycleBin -Force" and click the OK button.
Now, your trash will be cleaned according to schedule.
Turn off the system
For those who are passionate about working all night, this task is very useful, because it shows the message to turn off the computer, forcing them to stop working and on vacation. The code below will display the message (you can edit it in the script) at 11pm and turn off the system after 120 seconds (or 2 minutes). Note, you can change the shutdown time in the code below by changing the % time% value.
@
echo
off
:a
If %
time
%==23:00:00.00 goto :b
goto a:
:b
shutdown
.exe
/s
/f
/t
120
/c
"Time To Say Good Night!"
exit
Note : You will have 120 seconds to save the job instead of the default 30 seconds. Alternatively, you can stop the shutdown process by pressing Win + R and typing shutdown -a , then press Enter .
Backup files / folders
There are many good programs to back up files, including cloud solutions like Dropbox and Backup and Sync from Google. However, if you want more control and backup of sensitive files to a portable hard drive, you can use a batch automation solution.
- Complete how to use all backup and restore tools on Windows 10
Note, this method only backs up specific files and folders, does not create a system restore point or back up the system. Below is the code of the batch file to back up all data inside the user directory and back up the system registry:
- Instructions for restoring the system on Windows
@
echo
off
:: Set the folder to backup below
set
sourcedir=C:UsersUSER
:: Set your portable drive's folder below
set
targetdir=D:Backup
if
not exist
"%targetdir%"
mkdir
"%targetdir%"
echo
### Backing up your profile…
robocopy %sourcedir% %targetdir% *
/e
/j
/r
:10
/v
echo
### Backing up the registry…
if
exist
"%targetdir%regbackup.reg"
del
"%targetdir%regbackup.reg"
regedit.exe
/e
"%targetdir%regbackup.reg"
echo
### Backup is all complete…
pause
exit
I wish you all success!
See more:
- How to use Ellp to automate tasks for Windows
- Automate routine tasks with WinMacro v1.2.1 Utility
- Automate tasks in KDE
You should read it
- 5 ways to open Task Scheduler in Windows 10
- How to automate batch files using Task Scheduler on Windows
- How does the software run automatically on Windows?
- All problems about using Task Manager
- Ways to enable Task Manager in Windows 11
- Managing tasks on Android easily without Task Killer
- How to Run Powershell
- How to open Task Manager, introduce the functions in Task Manager
- How to hide the 'Task View' button on Windows 11
- Preparing for a new Task Manager on Windows 11
- Instructions to fix Task Manager has been Disabled by your Administrator
- 4 How to open Task Manager Windows 11
Maybe you are interested
How many weeks, days, hours, minutes, seconds are there in a year? How to find broken symlinks in Linux How to backup and restore the Office license key for all versions How to download images on the web in bulk on a computer Transfer contacts from any smartphone to Windows Phone 8.1 Quickly change the location of a row in the Word 2013 table