A DIY Batch File that automates restarting an App Daily

Subscribers:
3,310
Published on ● Video Link: https://www.youtube.com/watch?v=21GXm61wSgM



Duration: 6:25
183 views
11


In todays video, I'll show you how to make a batch file in Win that will Automate Restarting a Program, so you don't have to be physically on the computer to do so. I personally use this daily in my Raspberry Pi 4 Miners, with Win 11 hosting as the Operating System. I have a few Passive Income Apps That run better when restarted, and I don't wish to drop what I'm doing to manage this action. To build our Batch file we will be downloading Notepad++. This is a great tool, and I think everyone should use it, and at Free, you can't beat the price. To download the program, you're going to want to check out the link below, or find it in the description.
https://notepad-plus-plus.org/downloads/
https://stackoverflow.com/questions/47708279/batch-file-restart-program-every-day-at-fix-time
You can also simply Google NotePad ++ and the first link you find should take you to the downloads page. Once in the Downloads page you will see each version they have available for download. Feel free to review the different versions, however for today we will simply download the newest. At the time of making this Video the newest version is 8.4, and they are calling it, Stand up for Ukraine. After you have selected the version you will be using, you will be directed to that versions Download Page. Here you will see the Standard Downloads for 64bit versions of Win. You will also find a section for 32bit versions of Win. They have also added an Arm 64bit section for anyone running Win on a Raspberry Pi. I am running a 64bit version of Win, and the download listed as installer is simple to use. Once you have it downloaded simply install it. I'm not going to walk you through the installation as it really is just clicking yes a bunch of times. Finding the needed Batch file commands was really easy to do. Literately all I did was google, "Batch files for restarting a program." The very first thing that comes up is a post off of stackoverflow.com. Basically, someone asked how to restart a program at a fixed time using a batch file, and it was answered by a user going by the name, "ACatinLove". The Batch Commands that are being used as an example simply restart notepad. We're going to use the same commands. However, we will edit the commands by removing the executable for Notepad, and replacing it with the executable for a program called income. We're going to do this by copying the commands, and then pasting them into Notepad ++. After we've copied the batch commands and pasted them into Note Pad ++, we will need to edit the two lines that contain the word notepad. We will be replacing the word notepad with income.main. Once all of our changes have been made, we will save our file, naming it the same, income.main, and we will make sure that under file type we have selected batch file. Now we need to find our programs executable file, and place our newly made batch file in the same folder. This way the Batch File has access to the Program we wish to automate. To do this we simply use the programs shortcut to tell us where the programs executable file is. This information can be accessed off of the shortcut by right clicking on the Shortcut and clicking on Properties. Under the Properties tab you'll see an area that says Target. This area indicates what folder houses our Executable file, and where we need to paste our Batch file. We're going to navigate to our executable file’s location. Then Verify that we are in the same folder as the executable file. Once we know we are in the right place we will paste our Newly made batch file into the same folder as our executable file. Once we have our newly made Batch File working and in place, we'll right click on it, and send a shortcut to our desktop. We're going to use the batch files shortcut, that we just sent to our desktop, to Automate starting the batch file, each time the computer restarts. This will make sure the batch file is running every time the computer starts up. Now that we have our batch file in the right place test it, and see if it runs.

Subscribe: https://www.youtube.com/channel/UCRZx8k-2Wxi9-5EEKHCpVlQ?sub_confirmation=1

This Information is provided Free for Entertainment Purposes Only. These Videos are “use at your own risk,” so don’t work beyond your capability and seek help if you need it. Remember, safety first! Make Backups Software or Hardware as Needed. You Use it as you wish. If you choose to share your or your family’s results online, please do so responsibly and safely. We hope you enjoy this free programming.







Tags:
.bat