Web User - UK (2019-10-16)

(Antfer) #1
Weekend Project

Get to grips with some serious tech tinkering to

boost your computer andother devices

58 16 - 29 October 2019


Howto

... Create batch files to

automate PC chores

Wayne Williamsexplains how to write some simple instructions for


your PC to run basic tasks that you perform regularly


What you need to know
A batch file is atext file with a special
‘.bat’ file extension. Itcontains a list of
commands that acomputer can
understand.You can create the file in
Windows Notepad,WordPad or anytool
that can create a text file.The commands
used in a batch file are basically the same
instructionsyou would enter into the
Windows Command Promptto achieve a
specific task, butyou canstring any


B

atch files have beenaround for a very long time. They were originally run in DOS
andearly versions of Windows, and are simply text files that carry out a sequence
of commands. Probably the best known example for peopleof a certain age is
Autoexec.bat, which was used to execute a string of tasks when the PC firstbooted,
including setting the date andtime, loading mouse andkeyboarddrivers, andstarting
Windows. These days few peopleuse batchfiles, but that doesn’t meanthey don’t still
serve a useful purpose. If you need to run a series ofcommandson Windows, then
creating a batchfile to do this isprobably the best and quickest solution.
Batch files can look complicated but they are actually very straighforward, as we’ll
show you in this issue’s Weekend Project.

This simple batch file displays a message
and thenwaits for you to press akey

M T W T F S S

number of themtogether, savingyou
time and effort. In some cases,you need
to run the batch file inAdministrator
modeto give it the privileges necessary
to complete the tasks.

Command basics
Our MiniWorkshop, opposite, shows you
howto create a simple batch file and
covers afew commands, but there are
plenty of othersyou can use.You can
Free download pdf