Windows has had a search option for a very long time. The problem that I have with it is two-fold:

  1. It is slow
  2. The indexer is a real
  3. resource hog

So, a long time ago, I learned how to index all of the files on my computer that provides me with accurate results in a fraction of the time. And, the index is completely portable so I can keep a copy of the index on my USB drive so that I can tell my wife exactly where that file is on my computer at home that I need at work.

How exactly is this done? Read on.

Create the Index

The index is really nothing more than a text file listing every single file that is on your computer’s hard drive. To create the index, simple go to a command prompt and type the following:

dir c:\ /s /b>>fileindex.txt

Wait for a couple of seconds and it will be done. If you want to add more hard drives to the index, simply retype the command and change the c: drive letter in the command to the other drive letter you want to index.

Search the Index

The next step is to search the file index for a file you are looking for. Let’s say you are looking for a file with the word “accounting” in it. You would use the following command to get a list of all the files with the work “accounting” in them:

find "accounting" fileindex.txt

You will instantly get the results. No waiting!

Updating the Index

Since it is so quick and easy to build the index, to update the index all you need to do is delete the fileindex.txt file and recreate the index just like you did earlier.

Suggestions

What you may want to do to simplify the process is create a couple of batch files to simplify the process. For example, you could create a batch file called MakeIndex.bat that would delete the fileindex.txt file and then rebuild it with information from all of your hard drives. This file may look something like this:

@echo off
del fileindex.txt
dir c:\ /s /b>>fileindex.txt
dir d:\ /s /b>>fileindex.txt

You could also create a file called WhereIs.bat that will find your files easier for you. It might look something like this:
@echo off
find %1 fileindex.txt

Now, all you would have to type is:

WhereIs "accounting"

This will give you the same results!

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Sometimes, it can be difficult to visualize what is happening inside a computer and we need a bit of help from the real world in order to get the concepts clearly. Here is an absolutely brilliant way of visualizing how OR, AND and XOR gates work using dominoes.

I can’t imagine how long it took this guy to do this but I have to admit that I am impressed!

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Telnet Star WarsWith all of the fancy e-mail programs out there, it is really easy to forget that e-mail had some pretty humble beginning with a simple text interface. And, it is still possible to send e-mail this way.

Now, I’m not really certain as to why you would want to send e-mail this way other than you have no choice or you just want to do it (GEEK!) but here is the process, step by step.

For this tutorial, we will use an example. In this example, our mail server is called smtp.maildomain.com. My e-mail address is me@maildomain.com and I am sending an e-mail to my friend at geekreader@maildomain.com. I want to send him an e-mail with a subject of Telnet Mail and the message will be I am sending this e-mail with telnet. Whenever you see these in the code portion of this tutorial, please replace it with your appropriate information.

Action

Command

Response

Connect to your mail server telnet smtp.maildomain.com 25 220 220 smtp.maildomain.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Mon, 30 Jul 2007 13:45:15 -0500
Introduce yourself helo 250 smtp.maildomain.com Hello [192.168.1.2]
Indicate who mail is from MAIL FROM: me@maildomain.com 250 2.1.0 me@maildomain.com…Sender OK
Indicate recipient of mail RCPT TO: geekreader@maildomain.com 250 2.1.5 geekreader@maildomain.com
Start message DATA 354 Start mail input; end with <CRLF>.<CRLF>
Add subject (press Enter twice to complete this command) Subject: Telnet Mail
Enter your message I am sending this e-mail with telnet.
Indicate that your are done . 250 2.6.0 <HJSDRC249CIGo7F5aOYf00000002@smtp.maildomain.com> Queued mail for delivery
Finish your session QUIT 221 2.0.0 smtp.maildomain.com Service closing transmission channel

The entire conversation should look something like this:

220 smtp.maildomain.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Mon, 30 Jul 2007 15:10:31 -0500
helo
250 smtp.maildomain.com Hello [192.168.1.2]
MAIL FROM: me@maildomain.com
250 2.1.0 me@maildomain.com....Sender OK
RCPT TO: geekreader@maildomain.com
250 2.1.5 geekreader@maildomain.com
DATA
354 Start mail input; end with .
Subject:Telnet Mail

I am sending this e-mail with telnet.
.
250 2.6.0 Queued mail for delivery
QUIT
221 2.0.0 smtp.maildomain.com Service closing transmission channel

Now, these are just the absolute basics for sending an e-mail. There are a lot of different options but this will at least get an e-mail out the door!

Now, if you are looking for some more fun with telnet, open up a telnet session to towel.blinkenlights.nl and see what Star Wars looks like in ASCII text!  (Yes, I know this has been around forever but I’ll bet that there is at least one reader who has not seen it!)

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Command PromptI was doing some tweaks on my new Vista system the other day. One of the things I wanted to so was add a bunch of Visio stencils to my system that I had downloaded from one of the hardware manufacturers. Unfortunately, there were over a hundred stencils and each one was compressed into a ZIP archive. I really didn’t relish right clicking on each zip file, clicking on Extract all…, etc.

So, in situations like this, I immediately drop down to the command prompt. This is where I decided to use the for command to perform and action on every file in the directory.

So, in my example, I used the following command:

for /R %z in (*.zip) do unzip "%z"

Within seconds, I had all of the files extracted and I was ready to go!

Let’s break down this command into its smaller components to see what each one does.

for - indicates that we are going to be using the for command
/R - tells the for command to recursively look in all folders within the active folder as well. Thus, if there are any files in subfolders, they will also be found
%z - this is the variable that will contain the filename that is found. This can be any number but it is case sensitive. If you want to use the for command in a batch file, you will need to use %% (e.g. %%z) instead of just %.
in (*.zip) - this is the search pattern that will be found. The portion in parenthesis uses the same wildcard scheme as the dir command.
do - indicates that the string following is the command that should be executed on each file found
unzip “%z” - this is the actual command that is executed for each file. The %z portion is replaced by the name of the file found. So, for example, if the file found was archive.zip, the command that would be executed would be unzip "archive.zip". Remember that is you are going to be doing this in a batch file, replace the single % with %%.

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Andrew is looking for a batch file that will copy some files for him.. Andrew writes:

I recently developed a way to allow Call of duty 2 to run in both the 1.2 and 1.3 version. The problem is, the people i’m trying to solicit to don’t understand english well, so i need to make a batch or executable to move two files in onew folder to two seperate folders. the folders are specifically: “C:\program files\activision\call of duty 2\1.2″ & “1.3″ In both “1.2″ and “1.3″, are two files: “CoD2MP_s.exe” and “iw_15.iwd”. basically, the only difference in the two versions are these two files.

So i need a batch to move the “CoD2MP_s.exe” into “c:\program files\etc…\call of duty 2\” and “iw_15.iwd” into another folder, “main”, under “call of duty 2″. basically, one batch file to move the 1.2 version files into the two folders, and another batch to move the 1.3 version files in those two folders.

I have no experience in programming, so i need as much help as i can get.

So, Andrew, if I understand you correctly, you have the folder:

C:\program files\activision\call of duty 2

In that folder, you have three folders:

C:\program files\activision\call of duty 2\1.2
C:\program files\activision\call of duty 2\1.3
C:\program files\activision\call of duty 2\main

You also have CoD2MP_s.exe in this folder.

Under C:\program files\activision\call of duty 2\1.2 and C:\program files\activision\call of duty 2\1.3, you have the two files CoD2MP_s.exe and iw_15.iwd.

What you are trying to do is create two batch files, one to activate version 1.2 and one to activate version 1.3. To do this, each batch file would copy CoD2MP_s.exe to C:\program files\activision\call of duty 2 and iw_15.iwd to C:\program files\activision\call of duty 2\main from their respective directories.

Luckily, this is a relatively easy thing to accomplish with a batch file. All we need to do is use the copy command and tell it where to copy the files to.

Here are the two batch files that I came up with:

Error: Could not open Set-1.2.bat

Error: Could not open Set-1.3.bat

Hopefully these files are pretty self explanatory with all of the remarks (rem lines).

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Next Page »