Engenharia informática

Páginas: 104 (25831 palavras) Publicado: 5 de maio de 2012
Preface

This book 'Batch File Programming' is written after experimenting and testing all the snippets
covered in this book. Batch File Programming is a pretty old one, but i have found lot of books that
haven’t covered the dark-side of the batch, which still remains untold. The ultimate goal of this book is to
make the readers understand how it works, what are the limitations of thebatch, what else is possible with
a batch, constructing useful programs with various views, Creating a batch virus by mis-using the
commands, creating a batch file to an executable and lot more.

This book is aimed at novice to advanced programmer, No matter if you are new to programming,
this would be the right drive to start with, since this book contains real time examples along withscreenshots that really helps in a better understanding of the concept.

First Edition May 2009

Acknowledgements

First and foremost I would like to thank my Mum and Dad for their constant care and blessings.

My Special thanks to Mr. C. Robinson (CEO, W3cert), for his kind encouragement in authoring
this book more over I cannot forget to express my gratitude for my relatives and comrades.

Ihaven’t seen him anywhere before, but it’s my duty to owe my gratitude to him and he is none
other than the Almighty God for the inspiration and guidance in all my successful stages.

First Edition May 2009

Dedicated to

This Book is dedicated to W3Cert and I hope the contents in this E-Book ‘Batch File
Programming’ will really help the students of W3Cert for their exploration in batchfile programming
and interfering with the windows kernel by using the commands given in this book.

First Edition May 2009

This page is intentionally left blank

Batch File
Programming

1

Batch File Programming

Introduction
Batch file programming is the native programming offered by the Microsoft Windows Operating
System. Batch file is created using any text editors likenotepad, WordPad, WinWord or so on, which
comprises of a sequence of built-in commands used to perform some often done tasks like deleting a
series of files of same type or of different type, creating logs, clearing unwanted craps from your
computer and even for creating a batch VIRUS.
Whenever a Batch program is executed, it was interpreted line-by-line by the CLI (Command
Line Interpreter)command.com or the cmd.exe. Batch file is really helpful in automating tedious tasks
and for maintaining system logs. The commands used while creating a batch file are case insensitive, in
the sense that it may accept both small and upper case letters.
Modes:
There are two different modes that are supported by DOS (Disk Operating System), they were,
1. Interactive Mode.
2. Batch Mode (SilentMode).
Interactive mode:
In interactive mode, when a command is executed, it interacts with the user for input and
depending upon the input supplied by the user, the further processes are carried out. For example, let’s
take the ‘del’ command.
The ‘del’ command is used for deleting files that reside inside a directory. Now I am going to
delete all the files inside a folder named ‘a’, and when Iexecuted the following command, it is interacting
with me prompting “Are you sure (Y/N)?”, confirming the deletion operation, and depending upon my
input, it decides what to do. If I hit ‘Y’ then it will delete the files specified, else if I hit ‘N’ then it won’t
delete.

2

C:\>del a
C:\a\*, Are you sure (Y/N)? y
Batch Mode:
Batch mode can also be referred as ‘Silent mode’ or ‘QuietMode’, and this is mere opposite to
the interactive mode. The command that operates at batch mode will never interact with the user at any
instance, instead it will take care of every operation by itself.
For example, I am going to explain this by using the same ‘del’ command. There is a switch available for
the ‘del’ command, which makes the command to operate at silent mode, and that switch...
Ler documento completo

Por favor, assinar para o acesso.

Estes textos também podem ser interessantes

  • Informática na engenharia
  • Engenharia informatica
  • Engenharia informatica
  • Engenharia informática
  • informatica na engenharia
  • Informática para engenharia
  • Informatica na engenharia
  • Engenharia informática

Seja um membro do Trabalhos Feitos

CADASTRE-SE AGORA!