Difference between revisions of "Desktop scripting/bat files"

From Adam Meola - wiki
Jump to navigation Jump to search
(Created page with "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 pla...")
 
Line 1: Line 1:
 +
==bat Files!==
 +
(available for windows)
 +
 
Bat files are (possibly) the easiest way to automate a given task on 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!
 
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:
 +
:: <code>.>[nameYourFileHere].bat</code>
 +
::* 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.

Revision as of 16:51, 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.