Saturday, November 10, 2007

Keeping vigil on your personal computer

Sarabjeet Singh Kanwal write:
WHEN you are not at home, if someone uses your PC, you may want to note the date and time your PC starts to keep a tab on the activity in your absence. Here we present a wonderful program step-by-step, which activates each time when your PC starts and stores the date and time in a file without knowledge of the user.

Step 1:
A file named autoexec.bat is present in the root directory of your bootable disc.
Add following statements to the end of this file:
@echo off
date <>> file2
time <>> file2
echo. >> file2
Caution: Don’t delete the previous contents of autoexec.bat file. Just add these statements to the end of the file, lest your PC may not work properly.

Step 2:Now you have to create a file named file1 from DOS prompt, in the same root directory where autoexec.bat is placed. File1 is to be created as shown below:
· Copy con file1 <>
· Again press enter key
· Press F6 key
· Press enter key
You will see a message – 1 file(s) copied.

Now onwards, whenever your computer is started, the date and time of start will be stored in file2. You can check all dates and times by giving command: "Type file2" at DOS prompt of root directory.

This program works with DOS 6.22 and previous versions and also with Win9x. It may not work with Win NT and Windows 2000.
Explanation of program:Whenever your computer starts, statements in autoexec.bat file are automatically executed.

1) date <>> file2
To understand above statement, we split it into two statements:
date >> file2
date < file1
The ">>" operator is a redirection operator, used to append (add text to end of a file) output of the command/file on its LHS to the file on its RHS. Hence "date >> file2" will append output of date command to output file. Similar case is with time command. Now, the problem is that the date and time commands seek input from the user by prompting: "Enter new time/date". At this time we have to press ENTER key. In our program we store ENTER in file1. "date < file1" statement redirects its output (i.e. ENTER) to date command. Hence we don’t need to press ENTER key manually.

2) "echo." statement leaves one line blank. This blank line is further redirected to file2. It will leave one line blank after every date and time.
3) "@echo off" causes all statements to execute invisibly.

1 comment:

Unknown said...

Travel of Dreams has been committed to bringing our clients the best in value and quality travel packages. We are passionate about travel and we provide best in class service to our clients. Our prime goal is customer satisfaction, thus, we believe in providing best services to our patrons at an affordable rate. We are a team of dedicated and hard wworking professionals and we all aim to have numerous satisfied customers. We know that our company depends upon fulfilling our clients needs every day and this is also our promise. View More:- Travel Of Dreams