Learn Batch Scripting - Windows & Task Automation 2020 | Genius Hub | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Learn Batch Scripting - Windows & Task Automation 2020

teacher avatar Genius Hub, Wouldn't You Rather Be A Genius ?

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

16 Lessons (1h 13m)
    • 1. Course Introduction

    • 2. Fundamentals

    • 3. The Command Line

    • 4. Batch Scripting

    • 5. Loops & If Statements

    • 6. Applications

    • 7. The Task Scheduler

    • 8. Launching Applications

    • 9. Automating Applications

    • 10. Triggers & Conditions

    • 11. Files

    • 12. Working With Files

    • 13. Organizing Files

    • 14. Archiving Files

    • 15. Compressing Files

    • 16. Conclusion

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Automate the boring stuff with the help of the task scheduler and batch scripting!

If you use a computer on a regular basis you know how frustrating it can be constantly doing small tedious tasks. If only your computer could do all that automatically. Well, it can! All it takes is learning how to use the windows tools that are already into your computer.

Being able to do time consuming task with a click of a button makes a huge difference.

Sharing my knowledge and making my students more efficient and effective at using their computer was the main reason i decided to create this course and i hope that you find it just as invaluable as i did.

Enroll now to take control of you time once and for all.

Hope to see you soon.

Meet Your Teacher

Teacher Profile Image

Genius Hub

Wouldn't You Rather Be A Genius ?


Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Course Introduction: Welcome to the Windows automation using bad scripting cars. If you use a computer on a regular basis, you know how frustrating can be constantly doing small, tedious tasks. Having to open all your favorite programs for your computer. Starts cleaning all the temporarily fires you forget. Delete from your desktop or running your monthly at the virus can. Sounds boring, right? If only a computer could do all that automatically. Well, it can. That's why they were made for, after all, one day to do the boring stuff so you can enjoy your life. All the takes is learning how to use the Windows tools that are already into your computer . Speaking of tools, will tell you, look at the ones we're going to be using starting with tasks schedule. Throughout this course, we will be using the task scheduler automatically Lance applications or execute scripts. But many people don't know is that many Windows prose is themselves Make user that's scheduled to complete tasks such as this. Fragmentation or file cleanup along with that schedule will make use of another barbell door, the witness command and specifically, bad script. Bad scripts allow us to execute dust in a sequence and provide the planet off tools and commands that an invaluable for automation while learning how great scripts might sound intimidating, do not worry. The commands we will be using are fairly straightforward and with just a bit of practice, they can be mastered quickly so quickly. In fact, for them coffin it. After this hour, Long course, you will be ableto automatic Ilan's applications in automate small tasks within them. Use the command line in about scripting to do tedious everyday tasks such as renaming, moving or deleting multiple files. Organiser files in any way you like. Automatically safe, copious amounts of time by creating your very own automates the scripts in automating your tasks and much, much more, personally learning winners. Automation was one of the best decisions I ever made because it has finally changed the way I use my computer. Being able to do time consuming task with Akiko Bottom makes a huge difference. Sharing my knowledge and making my students more efficient and effective by using computers was the main reason I decided to create these cars, and they hope to find it just as invaluable as I did and roll now and take control of your time once and for all hope to see you soon 2. Fundamentals: welcome to the first section of the course. The section is all about the fundamentals. It's intended to give you an introduction in some experience in the halting a deal. This will be using the ultimate Windows. Please keep in mind that this section is intended for complete beginners only if you feel that you already know the basics of the command line for have enrolled in our complete wings come online cars. Feel free to skip this section. Example straightly documenting windows in any of the following sections. Otherwise, here is what ruler We will learn, what the winners come online means and why it, along with bats groups are the perfect goals were real. Is automation what commands and parameters are and how we can use it, as well as the very basics of arts programming, so that you can create your very own automation streets, everything from valuables. In these statements, factions and loops re patient Samuel, you might be tempted to jump straight into the affirmation part of this course. Let's give this section, which is all about the fundamentals of bad scripting in the commanding, even though you might not be fully familiar with that If that's the case, please keep in mind that in order for you to be fully prepared, it's essential that you gain the knowledge and experience which you will need to automate tasks. So if you are a beginner, please bear with me for the following few lectures and they will learn the basics. With that said, Let's begin the first lecture. 3. The Command Line: Welcome to the first lecture of these cars. This lecture is all about the fundamentals of the winds Come on like specifically, we will learn what their wieners come on, my knees and why we need what commands and parameters are and how we can use them, as well as how to view our valves and change our current directory from local before we get going. I created a few takes documents in my dad Stop, which we will use to practice a few months in a commander who, free to do the same with that, said, Let's get started. Let's begin by learning what the command line is and why we needed come on line. Also called the Command Prompt, or CMD is a text based user in the crease. That means that the only way to it there, actually is that commands command. He's a world, tells the command line, docked in a specific way or completely specific tasks by using bad scripts were combined wolf commands and run the minute sequence. That's the completion of a task and us automate windows. We're going to learn more about bad scrapes later on. The command line is the perfect tool for Windows automation because provides a player after walls and comments that are invaluable for automation. Not only that, but the commander is also the native way of interacting with windows and thus is a perfect job for automating any tasks within. Without said, Let's begin learning about the command like some of you might already know how to do what follows. However, I'm going to go over its for the people of the No. Let's first open the command line. But I mean CMD in your search for its electing the heart zone. The French. The lines on the command line contains that information about the Windows version. Just below that, you can see your current working directory or, in other words, the folder for directory have to reach the command. Prompt is lucky that now seems like the file manager. The command line operates in a specific location, in this case, the Julian for it. So these will be the equivalent of navigating to that folder from we know it's exploring back dark. You can even you the files over directory by using the deer. Come on, change our current directory. You can use their CV command which stands for change directory. For example, taping C V Day Stop will change your current directory from six lanes. User slash Julian, who see slash users last Julian's Last Nestor can extend the functionality of commands, were using parameters Parameters. Also called arguments are options. Have specific words. Letters or symbols can be typed after any command daughter surge in some way. For example, we can type B along with slash po and parameter to display all the faults, nor there's no in alphabetical order. Parameters are different for every command, and memorizing the mall is nearly impossible. That's not the mission, however, because by tapping the world help before any command will immunity display a full least off every available parameter option for the selected common. Even help you deal these. No support for a command. The command line prompt you to use this last question mark around, Keep in mind. And while most utilities in command support the use of the hell command, all this last question my parameter there sandal, do not. Apart from your in your files, we can use the command line completely. Mayor pasts ranging from relating multiple piles at once or moving them to a specific location. All regions one common, for example, by diving pools, followed by the name of the file. You want to move in. The director you want to move it into will transfer our fire in the same way we can replace more with a command copy to duplicate or copy our files. We can also use their own command to rename them for the Dell Command to relieve him, among others. What do you have the name of a felt you want to rename, move or otherwise? The command line will open that file. Onley in the current directory African modifier file, regardless of the directory, were like 18. But having its Wolpe, he said, the styling directly its name. As you can see here, as long as you get with a full path of a file, you can modify it from any directory in your command. Keep in mind that if your application contains his base within, it will have to place it in quotation marks or else it won't be recognized by the commander . Summary. The command line is the perfect tool for automation because provides pleasure after goals from commands. Parameters are specific wards like there's more symbols like, um, we typed out there. Any command called its function in some way you can modify far from any directory by typing its full path instead of its name directly. That's it. These concludes our lecture. If you feel that you, me something makes you re watch the selections, that you fully understand everything and that you're prepared for the following lectures, make sure you put the practice what you have learned thus far. Until then, see on the next lecture. 4. Batch Scripting: Welcome to another lecture of these cars. This lecture is all about the fundamentals of our stripping. We will learn how to create our very own bad script, how we can use it to bring wards in Torkham online, as well as how to execute commands for bad script glutamate. Small tasks, just like the last time, have created a few takes documents in my days, which we will use to practice bad scripting. Feel free to do the same. With that said, Let's get started. Well, the command line is great for completing tasks it requires user England. In other words, the completion of tasks is not automatic. Not your bad scripts coming. A bad script is a file pertaining multiple lines with commands for their exit duty, one after the other by the command prompt. With bad script, we can enter the cold that's required to complete a task only wiles and have it done automatically. But streets are extremely powerful and can be used to accomplish a range of tests such as simple file organization, the automating a part of your work. We're going to dive deep into all the ways you can use bad scrapes to make your life easier in the following lectures. For now, however, let's greater first basket seems a batch. Keep is a textile containing a sequence of commands to create one. All we have to do is great that extra and simply add some cold, I hope, for your newly created excel in life echo followed by Hello. The command is primarily used to bring viable to no strings to the common life similar to print or console that right line in other languages. In this case, we're going to use it to bring the world hello in Torkham early. Directly beneath brings a type of command pause. That's because ready fault, the command line automatically draws is itself. There are no more commander of Iran, since in these case we want to look at the output of the Echo command. We need to use the Pause Command to prevent the command line from closing. Let's now save our file, my going over to file and then save us bad scripts. Using that but extension to make her file executable, we need to replace the dot txt after the Neymar fell into that. But finally, click save. It's no execute our power simply by double clicking. As you can see the command line in meeting realities and execute our commands, you might know Piece of the command line shows the current directory and the command that is being executed because young its output when running scripts, however, might want of you just the output of a command to do so. First, we need tracks. The commercial life, by pressing any key, has instructed Viatical. Miley, then was simply need to go back to our screen brightly, select Eddie and at Echo Off as the first line and say, upon running this creep once again, you can see that only the output of our commands. He's shown this time pretty simple, right? Let's no try using some of the commands we learned in the previous lecture. Daughter made a few basic tasks. For example, let's right the bad script that organizing the files, you know, they're stop in a specific way. Let's say that they want to move our A and re piles into separate folders in the leader. See fire first the whole thing structure script to move toward Lester directory with a CD command and then greater folders with empty de Comer, which stance or make director know that quotation marks are required in these days because the names of the fathers want crave contain spaces. Afterwards, let's instructor scrape to move in. The leader files a property. No door if you need. Let's run on script and see if it works. And indeed it does. In the next relations, we're going to learn how the implements and logic interest rates. For now, however, feel free to experiment by creating a few scripts on your old and making them bring a number of things into the commercially or automate a few small casts. Summary. The bad script is simply a pile that contains multiple commands that around in a sequence. Scrapes need to be saved without that bad extension in order for them to be executed. Adding at a calls at the beginning and pause at the end of our street will show the output of commands incremental Kome Island from automatically closing. That's it. These concludes our lecture. If you really let you me something makes you Yuri votes lecture that you fully understand everything and that you're prepared for the following lectures. Make sure the Jupiter practice what you have learned. That's hard. Until then, see you on the next lecture 5. Loops & If Statements: welcome rather lecture of this course in these lectures. We want to take a closer look at bats, programming everything from what loops are and why they're perfect for automation. How to look through all the files in the directory and execute the command about each one. So how to look for a specific file in the directory and perform a task hospital usual. How craved a few text documents in my dad's, which will use for rockets? Feel free to do the same. With that said, Let's get started. Lohps. One of the most basic personal, dangerously powerful programming concepts are Lopes. We can use Lopes reprinting instruction until a specified conditions. Man, In these days, let's say I want to bring the name of every file in a directory, just like the last time. First will be struck. Our scrape the movie director in way through look or piles in these days, for example, the desktop Father let's implement our look now driving for, followed by 2% signs, directly followed by a character, the world in the Asterix, while card within viruses along in the world dough and then apprentices again, and then the command he wants around. Let's break down each element of this look are a parameter, specifies a single letter replaceable parameter. You can replace a with any letter of your choice. These similar to a viable in the sense that it's value changes. However, it seemed axis slightly Deaver. It requires 2% of science before its name when using the command and however, instead of a bat script only 1% I inscribe. That is because the four look requires that these parameter has just a single percentage. However, a single percent sign would not be interpreted correctly by the COMMERCIALLY because it has a special meaning when it's right for a bad script, thus pointing to use one more percent sign. So the family knows that what follows is a little represented sign. After that, we heard the Asterix wildcard wildcard personal symbols that take the place of characters or words. In this case, the Asterix wildcard instructs the command line loop forever foul. In our current directory, for example, we wanted to look only through fast that have the world are some somewhere within them. You'll have to type in Asterix, Hayward Awesome in the National Excellence Again, the Asterix take the place of works that might be before or after our work. In the next few lectures, we will learn how to restrict which fast we will open, depending on their name extension and more. And finally, environ disease. We have the command that they will be executed for every file in our love in these days will seem to be the name of the file. Using the echo common upon running our screen, you can see that all the files nor their stuff appear successful are for lope will only look or files in that directory in everything. And it's after aggressive Michael Bay. The local files Recourse Italy. You can use the slash r parameter. Other parameters include slash D, which will look for folders slash help, which is for looking car instead of numbers and finally slash share. What you love through text a part of simply viewing the names of our files got complete. Any tasks The same where we go from the Comolli replacing the echo common. We learn more about how to do just that in the following lectures. If statelets broken. Also, look one a specific phile by adding in the statement ive statements will go on Market street function differently in certain circumstances by determining the cause that needs to be wrong. Great. The name statement Similar type East, followed by are a parameter to Equality signs the name of the file we want to look for and finally, the quantum on Deron if the statements troop within piracies. Similarly, that's also the nail statement was ruled Iran. Anytime Ari's they went returns false. The command line. Figure out your the value for a parameter physical than the file we're looking for and Informa's a property. Let's save and run our script. Success, as you can probably tell about screaming, can get quite complicated. However, this election is merely introduction to the basics. You will go much more in depth as we use scripts that automate more advanced tasks in our computer. However, with what you have learned in these in the previous lectures, you should be able to perform some basic automation tasks. Summary lobes are very powerful, and they're extremely useful for automating, repetitive past. We're looking through files can execute any command about each item automatically the same what we do from the Comolli by reminding if statement in garlands. They're vastly expanded Factional. That's it. These clothes are lecture. If you feel that to me, something Make sure, Really? What? Selection? Such a full. Understand everything that you prepared for the following lectures. Make sure you put to practice what you have learned thus far. Until then, see on the next election. 6. Applications: welcome to the second section of the course. The section is all about automating applications. Specifically, we're going to learn how to create scrapes, the automatic external complications that start up how to start a number of hard cases when the condition is met, such as the current date or time, or when a specific event, of course. And finally, how do automate tasks within our applications using their building parameters, daughter must be complete. All the tasks just mentioned will make use of Batch keeps as well as the task scheduler. A task scheduler is a built in Windows. Though designed to automate tasks and applications, many Windows processes themselves run automatically with the help of the task scheduler, such as Windows updates or thes department ation. Similarly, we can use it to lance. Applications are exiting bats groups at a particular date or time or when a specific event . Of course, starting off, you will find out how we can use it to lunch a number of applications at System startup. Until then, see on the next election 7. The Task Scheduler: welcome. Another lecture of these cops in these elections were going to automate our first past. We're going to start with an introduction to the Windows Task Scheduler. We're going to learn how great our first task and how to make appreciation to start in that computer. Let's get started. The first thing we often do where we started computer is the lunch, all our favorite applications. Let's save ourselves, sometimes with a helping with tasks schedule. The task Scheduler is a built in Windows to, but the name was the creation of automation dusts with the task Scheduler collects applications or screams at a specific date or time for when it specifically went. Of course, many windows processes themselves make use of the last scheduled to complete tasks such as these defragment, Asian or file cleaner. We can create automation. Ask Israel such as, for example, automating the large of a program for their season start up. In this case, it is not by open with US scheduler to do so. Simply type task scheduler in your search for and select diverse result. No, that passed. Stager is open to take a look around the panel of the left allows US Jews between a few interfaces. The past stager local, this place an overview of all the task of their schedule for have already been executed. A zealous the action spanning over there, which allows us to create new tasks for modify existing words. Selecting Task Scheduler Library this place and helps us navigate among all the tasks in our computer and gives us the option to model. It's nothing obligations. No, they were somewhat familiar with interface. Let's great new task simply by clicking that create basic past battle interaction. Spanner. A new window will immediately pop up, lasting for some more information. First, we need to enter the name of her new tasks, then select the Trigger Junior is an event that's when executed from this, not of our house. In the next few lectures, we'll go in depth about triggers and how it can use. For now, however, sees you want Trump does not with me goes seamlessly. When a loved being option, you might be wondering why we didn't select there when the computers. Now it's option, and that's because that option is in very for background scripts are services, another application that have a graphical user in the race. Such applications can only be Iran. Medical Burger has fully booked up in, the user has logged. Next select It's not a program, and finally we live just like the program on the lunch. Simply click, browse and find the location. Overcome executable if you're unsure about where you're excusable, is like 80 fine per set for your obligation. Sarker right, picky select properties and finds location from its 19 field. No, they have a relegation. Let's go back. A task scheduler like grows increased allocation at the location bar without coats and finally select executable, the task stager now gives us, and I saw where your heart ask. After checking everything, simply click finish to finalize it. Our task is now ready and is listed among our others natural tasks in the trigger. Stab reckons the trigger have selected. And next to that, we can see when our task over Iran next, as well as the result of its previous execution. Let's reboot on computer now to see if our application relax, and indeed he does. Upon opening our task scheduler once more, we consider that remonstrations execution was completely successfully in the next election . We're going to learn how to start training applications all at once. Usually, that's scheduler and about scraping. So stay pure summary task Scheduler is an immensely Barretto in its better approximation to launch an application startup creating new basic task using the task scheduler to find extendable segregation of your program, find its Charcot go to its properties on the executable location will be in the start in field. That's it. These concludes our lecture. If you feel that you, me something make sure we watch this lecture that you fully understand everything that you prepared for the following lectures Make sure you put the practice what you have learned thus far until then, see on the next lecture. 8. Launching Applications: welcome. Another lecture of the course in these lectures were going to use the task scheduler and bath scripting bottom in the lunch off our applications. We're going to learn how to launch applications from a bad script. How to create that ask but launches bad scripts with a task scheduler and how to lunch multiple applications, polit ones that our system startup for with a liquor bottle. Let's get started starting applications. In the previous lecture, we learned how Daughter Martha is not an application that our system start up with the help of the task scheduler. But what if you want to launch more than one application? We could create many individual tasks, but there's a better way about scripts. You can create task, but lunch, the bad script put starts all our applications to do so. First, we need to learn how to let's applications from the command line. There are three ways the command line largest applications. Let's go over the channel. I think they're an uncle months. We there Uncle months, you can only lance programs that are built into the Comolli, such as echo for city external applications cannot belong to retell commands and Thus, we will not be used directing vacation to start the program using the right on vacation excusable of your program needs to be located in the same directory as the Kamala. Let's try opening a command, navigate to the location of the comics suitable and copy Dallier using received the command . Now they're they're launches simply by having its name. And as you can see, Graham successfully lounges. This not the final way Kalonzo applications in the commercial is with the user list on Comer. Unlike direct invocation, you do not have to be in the same directory. Excludable Larkin Dean Clancy is not come on Palin's files from everywhere, including ones that, at least in your path and my own variable to start crab start, followed by an empty set of quotation marks. The location of the comics suitable. A zealous backwards slash and extendable name in quotation marks does not come on. The car's an empty set of quotation marks as the first murder, with four locations with braces. This is because start can be used open consultations well, and even the first night when is called. It is so That's the name for a new council window if you're executed. Segregation does not contain any spaces. Some type start followed by the location, creating our script. Now we know how plans applications from the command line. It's greater about speed. As you can see, I okayed him about script in my Users folder within the Scripts folder. Just everything is neat and tidy. You could create your about script someone like desktop, however, because relating going to be launching it with gas Scheduler. We needs allegations. Do not change otherwise. Out as we know, none successful. Plus, you're like me police files here that stuff the better. Sinbad scripts text files containing commands. The extruded Vita Comolli, the commands in the lands of the cases are like a man I can look at ST Clair about scripts . Hospital usual, I take off was the first line of her script and afterwards, entering all the commands that we're launching applications. As you can see we're using this now command is that of direct invocation say, was the trouble off changing our directory for every application? We will not be typing the Pause command this time because we want to call my leg to close automatically. Let's try lounging or scrape the Civic works pending. Maybe that's let's go back dark. Ask schedule in creating your task, which will execute about script. This scene where we need to put economics incurable in the previous lecture and our task has been successfully created since you're here, plays the lead the task of creating previously by selecting it and clicking delete in the Actions apartment. Let's rebuild our computer to see for task walks and indeed, he does work, well, automation. Now we know how to create Scripps of Lance applications. You can use them. Daughter Make Europe, in my case. Okay, the few screams to my desktop, but the one executed plan to set of obligations of the recession for a particular task, for example, ones. Time for game development. I can simply knots of the script, and you will start pull the necessary applications. Feel free to create a few similar streets on your own. Document your work environment summary Use direct invocation or this not command to lance applications from the command line for about script. Use it as scheduled. Daughter wanted the lunchbox scripts, which will complete tasks you can use bad scripts to start. Many applications are commodity. Penultimate Europe. That's it. Please converge Election. If you feel that you, me something, make surgery once it's lecture that you fully understand everything and that you're prepared for the following lectures, make sure you put a practice. What's happening? That's our until then zero on the next lecture. 9. Automating Applications: welcome for another election of these cars. In this lecture, we're going to automate our first application. We're going to learn how parameters can be used for automation, how to find all the available parameter options, often application and how to use them. Don't wait some tasks within them. Let's get started in the same way we can use barometers, doctor. The function of commands. We can use them, doctor. The function of applications as well. For example, let's modify a previous script and mean Crump navigate a few websites after its launch. To do so, we need to find all the available parameter options for a calm executable. We could either doing online search or we could use the help. Come on. Keep in mind that some applications may not have made their parameter options accessible with help common or may not have any available parameters. Let's navigate our executable directory and use the help command to find out if our comics incurable, has any available parameter options. In this case, As you can see, Girl does not support the help utility. Let's tell using the slash question mark barometer as instructed by the commander. It seems that the comics incurable has not. Maybe it's available bottom of their options accessible. The other command like, however, a quick Google search reveals immediate of options such as slash Last Incognito, which starts krumping, incognito mode, or start maximized, which starts crop that full screen mode. Let's go back to our script and make from lunch with our parameter options. Open our webpages broken simply heart are your else in quotes, one of three other And as you can see out around in this creep grab successfully launches maximizing itself. Can never gets all our websites. If you are at times unsure about what a parameter option does, we'll try it using the command line before implementing it into your screen. There are many more parameter options available for automating girl welcoming your life easier. You can follow the same methodology thought of my cats not only in Crumb, but inside. Any application is well, think of all the applications you currently used, and that's what you do within them. And find out if there are any available parameter options for the automation. Although it might be deed used certain for every parameter option for every application you want to automate its automation will eventually save you a lot of time in the longer, However, while automation with parameters is great, these limited in some instances, example in our case, we cannot make up interact with the Web site. It has opened beautifully inherit limitations that are imposed by the parameters that are available to us. In other words, the degree of the automation often application depends entirely on the options his developers have given us, which in most instances are somewhat limited steel. With barometer options, you will be able to automate, at the very least, a part of your work summary. In the same way we use parameters that change the function of commands. We can use them to change the function of complications and make them ultimate tasks. If in executable, does not support the healthy user slash Christie mark parameter have been struck by the Comolli or conduct an online search, although it might be used to search for parameter options. The automation of your application will save you a lot of time in the long run. That seat these concludes our lecture. If you feel that to me, something makes you re wants his lecture such a fully understand everything that to prepare for the following lectures, make sure you put to practice what you have learned thus far. Until then, see on the next lecture. 10. Triggers & Conditions: welcome another lecture of this course in this lecture, we're going to make an application or a script lunch. When a tree Gary set off, we're gonna take a look at all the trigger options that asked scheduled users. We're going to learn how to launch applications on a specific date or time, as well as how to launch applications when a specific set of conditions are met. Let's get started. In the previous lectures, we learned how to start applications automatically at System startup. This time, it's using task scheduler to launch applications. Have a specific time or day. First, let some of the task scheduler and you are options. Now let's create a task this time. Click. They create task bottle instead of the great basic task, just so we can take a look at a few additional options. Then enter name. Select your operating system in the configure for option Hey to the Triggers tab and click new here. You can see a myriad of options into years old set off our task. Most of them, however, are of no use to us because they are designed for use any more. Servers offer command line applications exceptions are they at Logan Option, which we discussed in a previous lecture and on schedule, which we're going to learn more about now. Let's elect on schedule. You can either have a task around the specific date of the month or on a specific day below . You can select the time tweets they went will be run by default. That's scheduler displays the current time and date, which in this case, he's trying. You can have your task run only ones they link quickly or model. Let's elect mortally and select every month for its example. I won't ask where on every first day of them. All the governors of the day or time below have the option to delay, repeat, stop and expire The task. You can select and configure whichever options apply in your case. Seems today is the first day of the month. The task will run if you want to test the task. Years. Health Say that asked the run of the according date by selecting it in the days option or alternatively, you can see me change your computer's date into the first day of the month. Let's go equity and go to the access now for this example, let's say they want to run a virus con every first day of the month. Click new, and from here you can enter the location of a rendezvous IRS executable along with the necessary parameters. In this case, since I'm using the built in windows on the virus, I'm going to enter the following location following the same methodology we used previously . We can find that this gun parameter he's slashes can let's daystar barometer in our command line first, and indeed it works. Let's go back the task schedule another parameter there in the arguments field. Finally, let's hear to the conditions snub to figure out. Ask further. From here, you can find the plethora of conditions which are tasked chemical videos for in these days , I want my virus can to run. Only my computer has been idle for a while, and I don't want it to stop. Even computer ceases to be idle. I'm going to leave the following settings by default. Our task has now been fully configured and will execute The virus can refers Dave them all in a similar way. You can go figure any similar tasks and, for example, set up cleanup organization days into each. You can empty your cycle being clean up your artistry party in this gosh and more. Now that you know how I think of a few tasks that you repeatedly do and use a task scheduler to automate them and make your life easier. Summary a task schedule you just the option, Durant asks. Once daily, weekly or monthly, we're launching obligations. You can enter any barometer options in the arguments feel there are a myriad of conditions we're gonna figure it asks for, such as whether the computer is being used or not. That's these concludes our lecture. If you feel that you, me something, make sure you re wards his lecture, that you fully understand everything and that you're prepared for the following lectures. Make sure you put the practice what you have learned last far on deal, then see on the next election 11. Files: welcome the third sex of the course. The section is all about automating tasks regarding our files. Specifically, we're going to learn how to create scrapes, had modify all the files in a location in some way how to select which files modified based on specific criteria and finally hold to compress and back up all our files Automatic e automatically complete. All the tasks are just mentioned. We will make use off bad scripting Come on line in the task scheduler. As examples, we're going to create a few scrapes that will not only help you learn but will also help you automate a few tasks. Specifically, as an example, we're going to greatest creep keeps your desktop clean moving select files from your desktop delegation and later corporations. Them increases based on your hard drive. You make use of the knowledge about our tools so that you can automate your own Windows tasks. Starting off, we'll find out how it can look for a set of files and execute a command about each of them . Until then, seeing on the next lecture 12. Working With Files: welcome another lecture of the course in this lecture, we're going to create a few more automation streets. We're going to learn how to move all the files from a directory, how to exclude a few files based on some criteria and learn what barometer extensions are and why they are immensely useful before we get going. Have great a few files in my day stop, which we will use for practice. Feel free to do the same. With that said, Let's get started moving files. If you're like me, you like her desktop clean. Often enough, however you're not feeling it with temporary are useless files. So let's great this creep keeps your best a plane by moving its files into a folder. The first thing We want Our scripted dope Mr. Navigate our desktop and create a new folder to make sure all folder is only great. It. Once it's implement any statement, it's like if followed by the words not exist. The name of our file and the empty their command exist. Diameter looks the name of every file in our directory and compares it to the one with pride. Season water filed, created only if it doesn't already exist. We used the not modifier. No older grades are folder. Let's start moving files within it. For that, we need to create a loop, which slips rhyme filed in our current directory and movies. It tore folder Do you operate? Our look only have the dough used, the for command, the Asterix wildcard and the move. Come on, you may have noticed within the move Command. My surrounded are a parameter in courts. That is because some of our file names contains basis without the quotes. The move command with only move files that do not have any spaces within their name and keep every other five. Please happens, because without the quotes, the souls of the separated words that make up the name of our file additional parameters, which it can't make sense off. And so it just gives that file. This is also the same reason as to why we are called to the beginning and end of locations that campaign spaces. It's on our screen, very high, very walks, and as you can see, he does. Apart from moving parts, we can use a number of commands the complete A variety of operations such as echo to bring their names or one of their attributes friend Rene them copy to move or duplicate them or even dealt to deliver selecting files. With this group you just created, we can only move all the files from our days of directory. In many cases, however, you might want to be more selective about weight. Trouser on the move. Let's first more The files backed our guest and, let's say, for example, that they want to keep sharp cuts and execute doubles in today's up and move everything else to do so willing to learn from their extensions. Barometer extensions are a combination of symbols and letters with one place before our single leather replaceable parameter can display specific information about each livable item. For example, my looping files or folders. I think that deal that punctuation mark and the letter eggs before our character will bring extension. Now that we know about bombs, they're extensions. We can use them to complete our script. Let's implement the new statement with a note parameter, and the experimenter extension there was in our statement. It's a moment. Another if statement for our shortcut files, which use their LNG extension and finally, let's take the more command the same way we did previously. How screen will now compare extension of every item envelope with the one with I D to figure out if they are identical Onley they're not. He will complete the process once more with our second extension, and if it's also not identical, it more. These insures that only files of the North treat our criteria will be moved. We can also only move files. Where's perceiving extension by not using the not barometer in or east a. Quick as you can see here by using other parameter extensions, you can move files based on many criteria. Here, you can find the least of the most commonly used parameter extensions that do just that summary used for loops to create automation, scrapes of copy, duplicate, delete or otherwise modify your files in any way you like. When creating directories or items. That should only be great. It once use any statement check whether the item already exists or not. Parameter extensions are a combination of symbols and letters I don't place before our single leather replacement parameter can display specific information about each livable item. That's this concludes our election. If you feel that to me, something makes you re watches like such a fool. Understand everything else. You're prepared for the following lectures. Make sure you put the practice what you have learned thus far. Until then, see on the next lecture. 13. Organizing Files: welcome. Another lecture of these cars in this lecture Going to organizer falls in a number of ways . We're going to learn how to organize our files based on the file type, how to organize files alphabetically or based on their size and how to use compare operators along with parameter extensions. Organizer falls in any way possible. Let's get started in the same way we use parameter extensions and need statements previously to modify only select files. We can't configure our scraped to organize the files within our fold. First, let's navigate our folder using the CD command and it's used. The M gave the command to create a few folders to a tree. Will use the group similar types of files. Then let's great a for loop for every time. Notice how the movie their files we use the no statement include both a V I and then before files. We did so because and our operators do not exist in about scripting as opposed to other programming languages. And so an else statement is the only way to go. If you want to avoid creating a separate loop, just one file time and our files and know perfectly organized the number of folders based on their extension. But why stop there? Apart from organizing raising extensions, we can use a number of parameter extensions, organize alphabetically or based on file size. For example, the following if statements will only move files to the beginning with the name. Things get more complicated, however, for organizing based on size. Because to do so, we need to use a compare operator other than to equality signs, which is water. However, using thus far in Norwich statements compare operators have specific wards that instruct the command that will be all right. Them seeing a specific way here is the least of compare operators, along with the functions. For this example, let's say they want more files. The lesson. One megabyte insides To do so. Recently released, we need to use the LSS operator in the Z parameter extension. As you can see, we need to render the size of our files in bites. In this case, since I want to move on Lee files or the less than one megabytes in size, I entered one million because one million bytes is about equal to one megabyte with the user compare operators and parameter extensions. You can organize your files in a number of different weights. Try to think all the ways you can organize your files that will improve your efficiency and productivity. Apart from using compare operators, organize your files. You can use them to expand the criteria by which he looked through files just like we did in the previous lecture, going back to our script now the way how completely it save it and make Iran automatically every time we start our computer with the use of the task scheduler, if you would rather have the task around monthly for the specific time, the same way we need in the rears lectures it took a while for the desktop is now clean, and all the trials are perfectly organized, summary since end. Or operators did not exist in bad scripting using l statement or create a separate lope. The move. Similar file types in the same folder. Compare operators are specific words and instruct Dave Command to compare items in a specific way. Make use of barometer extensions and compare operators. Organise your faults in any way you like. That's it. This concludes our lecture. If you feel let me. Something makes Suri what it's like. So such a full understand everything that you're prepared for the following lectures. Make sure you put the practice What? You have your last five until then, see on the next lecture. 14. Archiving Files: welcome to another lecture of these cars. In this lecture, we will learn how to our cover old files, how to use the four files command to look through files, what command variables are and how we can use them and how to use the four files command along with command viable, select and manipulate vials in ways previously impossible. Let's get started. Four files. We all have accumulated a number of old files into our computers, which were rarely are never use. You might have some your guy stuff. Right now these files simply see them your hard drive, needlessly consuming space. Let's create a bad script, which selects old files and moves them to new directory. From there, we can complete a number of operations on the files, such as com, President or even the leader. Let's get started to make our escape move on the old files we need to use the four files command. Four files be similar to the four command in lots of ways. However, the main difference is that, in our case is it allows us to select fast based on the last time they were modified, which is exactly what we need Before we start implementing our look, however, we need to create a folder in which we will place our old pals to create our archive. So just like last time since changer directory to where you want your ark after we located and use a need statement to check if it already exists before creating implement our loop over the following. Let's break down each element of Harlem. Like I said previously to using the four files, command isn't over. The four command we have were using last far because it has some additional options and Paxson's, which are essential for many tasks in these days for our carving our fast mixture for fires Coburn. We have our slash B parameter B stands for path is the location REITs before Files Command will look for files these days. After that, we have slash s, which instructs the for fast command to search adviser Carson, just like the are parameter in a regular for love. This last d parameter allows us to select files based on the last time they were modified. The miners, 30 after our d parameter makes itself. But the only look for files which were not modified in the last 30 days. If you would like to, you can change this number to any number of days. There are a few other ways you can also use this last D parameter, for example, entering class along with the day's date after our departure after you lonely select files after modified after today. Finally, we have this last see parameter, which allows us then to look common that will be executed for each file within viral disease. It is required that we types seem the slash c before our command in these days. How use the move command along with at Bath viable the room. Every file in the Globe Archive directory path is rather called a command viable, and in these cases it contains the location of each file. In our look, we learned much more about Come on viable later. Come on Valuables. Our love is no successfully implemented and removal files from our desktop into our archive folder. However, in many cases, are script will move old files without taking it or counter structure, resulting in them being out of place in the archive folder. This my cozies is such as applications or projects not load incorrectly due to some other files. Macy. So what can we do? Instead of moving files, we can make our scraped move on The entire directors previously with the for command with user parameter which has started are far lope. Don't live through folders with the four files command. This is not possible. Instead, we need to create the new statement with checks you. The item in the lope is a folder to do so. I went to use a command viable. Like we said previously, common variables as the name suggests variables which contains specific information about each item on our look. Here is the least of all the available command valuables in a 45 stroke based on our least , we need to use their apiece. The common viable chicken farfalle is a directory or not. Now we know how it's implement our if statement. Let's also create a loop for faults in the bay stuff that are not within any directories and can be moved to arca without causing any issues. Let's remove this last s parameter so that only the faults No, there is no but selected and not felt within any subdirectory. Alan Tate the collision off our if statement to false so it only files are moved. Let's see. Our script will now move old files from our days. Look to the archive folder. We start our script desserts for old files in any other directories simply create a loop for each one of them. We could, of course, have your script search for files on your users folder or ever your entire drive. However, I would recommend not doing so because our script could moving part of program for system fast. So make sure that our scrape runs only on user control directories such as the desktop or the Downloads folder, for example. No, that's great! Is ready retirement and see if it works. I can already see some of the files having moved to Modesto, but let's go into our archive folder to confirm. And as you can see, a number off house have been successfully moved. Let's go make a script Grant Ahmadi Every month, with the use of the task scheduler, you would rather you can have the dance ground, weekly or even daily the same way. We didn't know if he was lectures in the next few lectures we're going to learn how to start their script to compress or even delete or archive folder, so state your summary like a four look. The four files command contains additional features and options, which are invaluable. Execute the command for each item in a 45 slope you need to use this last see parameter has a last see him the slash c followed by the commanding Calderon. Common variables are, as the name suggests, variables which contains specific information about each item on Arlo, ranging from the name to their size or even the last time they were modified. That's even this concludes our lecture. If you feel that you, me something makes you re what is like that you fully understand everything that you prepared for the following lectures. Make sure you put the practice what you have learned thus far. I feel that I see on the next election 15. Compressing Files: welcome Another lecture of these cars. This lecture is all about automatically comprising files from the command line. We're going to learn about competition, knees and why we needed how to use real teen with those tools to compress her files and how to easily use their party tools such as window to comparison, falls even more before we get going higher. Created a few files in my day Stop, which we will use the practice. Feel free to do the same. With that said, Let's get started in the previous lecture. We carry this creep, which gathered All are old pals Intern Archive folder. No, they're old files are neatly in place. We can learn how to reduce their space on their harder by compressing them. If you would rather not use this cream to create in a previous lecture, we can apply what we learn today automatically complies any large files or directories by creating a few simple scripts. But first, what these compassion compression is a technique used by computers to reduce the size of files are using specialized programs for utilities such as seven Z poor winder, which facilitate algorithms that manipulate the beats that make up a file in such a way as to reduce their size. There are two types of compression algorithms, which are called Lucy and looseness. The farmer is the most commonly used in images or falls, where a slight drop in quality is excitable in return to larger relative savings, whereas the latter reduce the size of a foul without losing any of it later. Useless compression is really preferable. It's what we will be using throughout this lecture. By compressing our files, we confuse their size by nearly 70%. The amount of the compression depends on the file type were compressing as well as the compression algorithm being used. Like we said previously, come back. Windows provides a built in command line tool for compressing and uncle prison files named Compaq. The compression ratio, which is the amount of the compact command completes our foul, is not as high as we said by the tools. However, its ease of use and flexibility makes it notable. Its usage is very simple. I go back slash C hold by the name of the file you want to compress upon running the command your felt should be successfully compressed. Comprise an entire directory, along with any files within it, used a slash s parameter, which will recourse into every file and compress it. Make use of the Asterix wildcard to compress or un compress multiple files at once compressive use. They slash you parameter. If you're unsure about whether file is compressed or not, check if a Nikon off two arrows pointing at each other appears in the upper right of the file's icon. If the anchor of the two hours does not exist, the file is uncompressed third party doors. While the compact command is great, you could achieve a higher compression ratio by using 1/3 party, However, as we would later find out tools such as Winner take much longer to compress and then compress files and require much more resources from your computer. So use whichever you believe he's the best one year used in these parts of our lecture. We're going to learn how to use Weiner from the Comolli. Don't matter. Compressor fouls. The same principles were going to use the implement automatic oppression with where can be adopted for any compression utility such a seven zip without said, Let's get started. The first thing we have the dough is now not winner. If you have another idea, simply navigate to the freezer website and download the latest version with Window in South . Let's compressor first file from local Molly used to intern from the command line. We have to first find out Executable directory to navigate their from here. We can use direct invitation to lands executable. Let single use this last question mark parameter reviewed spam their options and, as you can see, the window utility lounges and this place is this parameter options. Having an object to the window directory everything they want to compress a file can get videos. That's what and my words variables coming environment variables allows the names just isn't viable, whose value is said through the operating system. When we enter command like a malign looks up the name of our command in our path environment variable among allegations so that allowed the path of Ottoman viable contains at least of applications in executable locations. Let's least following are executed publication in the path environment variable. It's a lot of talented without having to navigate their break click on the with the Cycle and Select System Scroll down to the related setting section. Click system in For In the Window that appears click advanced system settings and then environment variables near the bottom from here, hit over to the system Viable section. Locate and click the path environment viable and click Add. It finally clicked new and that the allocation of the director in which Wiener is located, followed by a backwards last just now be able to land stranger from in directory in your command line. If you cannot, you might have to restart to come online or even your computer. If you still can't get it to work, you'd have to resort to navigating the winner executable before enlarging it. Like really previously No. Three Phoenix Setting everything up. It's usually nerve to compress a file. We're going to use the following command. Let's break it down. A Stands for art Dark. I've been creating your R file slash. Our record simply comprises files. Slash y assumes Yes, for any Cory's that might come up. And finally we have the name of the new archive, followed by the name of the file. You want a compress? Let's try a month and as you can see an archive has been created. There are getting the contains a myriad of options and parameters. You can use the compress your files refer toa help utility any time to help you remember them. Now we know how to use window from the command line. Let's make the archiving script to create in the previous lecture to compress the archive folder with the following command. As you can see, I use the A deeper counter top in in case an archive already exists. And use the DF barometer, which will delete the original archive after the compressed archive husband created. If you rather have your archive deleted, simply use the air. Um, deal command along with this last you and Slash Esperon mater's. Our script is now ready. Salary. The compression ratio off the compact command is not as high as without particles. However. Its ease of use and flexibility makes it notable tools such as Winner take much longer to compress and then compress files and require more resources from your computer than the compact command. Use environment variables to lunch applications from any directory in the Somaliland without having to navigate their That's it. This concludes our lecture if you feel that to me, something makes you religious lecture so that you fully understand everything and not prepared for the following lectures. Make sure you put the practice what you have learned. That's far until then, see on the next lecture. 16. Conclusion: this brings us to the end of these cars, you know, hopefully have the knowledge the automated variety of tasks within windows to make your computer life easier and faster uses scripts were created or create your own daughter might Any task you do more than once. The beauty of bad scraping is that even complex tasks can be automated. So don't has day to create an automation script for any sort of task. President. Learning how to automate Windows was one of the most useful things I ever learned, and I am happy to have shared my knowledge with you. I hope you find winners automation as invaluable as I did. I really hope you have enjoyed these cars. I have certainly enjoyed it in you. Until then, seal the next course goodbye.