Difference between revisions of "Desktop scripting/bat files"

From Adam Meola - wiki
Jump to navigation Jump to search
 
Line 23: Line 23:
 
===Advanced usage===
 
===Advanced usage===
  
sh scripts can of course do far more than this, and I may one day cover it.
+
bat scripts can of course do far more than this, and I may one day cover it.
  
 
For example, they can provide input to terminal commands that require USER input!
 
For example, they can provide input to terminal commands that require USER input!
  
 
But for now, I leave you to https://www.google.com/
 
But for now, I leave you to https://www.google.com/

Latest revision as of 16:54, 2 September 2020

bat Files!

(available for windows)

Bat files are (possibly) the easiest way to automate a given task on windows.

If your task can be done from the command prompt, those actions can be saved to a file, then played back later; simply by double clicking it!

Setting up an bat script

1) cd to the folder where you'd like to save your script
2) run:
.>[nameYourFileHere].bat
  • this will create a blank plain text file of that name
3) Open the file you've just created in a text editor. (notepad, notepad++, Atom, vsCode, they're all fine)
4} Type and save whatever you'd like to run in the shell.
  • seperate commands with " && "

Using an bat script

double click the file you've created
  • a command prompt will open and run the command(s) that you've put in the bat file.

Advanced usage

bat scripts can of course do far more than this, and I may one day cover it.

For example, they can provide input to terminal commands that require USER input!

But for now, I leave you to https://www.google.com/