Wednesday, February 27, 2008

USB Drive AutoRun.inf Tweaking

The autorun.inf file is the key to getting your USB drive (or CD-ROM drive, for that matter) to perform certain actions automatically and customize it’s look in My Computer. The purpose of this article is to shed some light on how this can be done.

Autorun.inf Structure

The autorun.inf file is a simple text file that can be opened up in any text editor (e.g. notepad). It always starts with a section header of:

[autorun]

Below this header is a list of different options. Each of these options is in the following format:

option=value

where

option is the option that you want to set and value is the value that you are setting for that option. So, if you had an option foo and you wanted to be set to bar, then you would enter:

foo=bar

(Do not use foo=bar in your autorun.inf file as it is only an example, not a real option setting.)

That is all there really is to understand about the structure of an autorun.inf file. On to doing some actual cool stuff with it!

Setting a Custom Icon

To create a custom icon for your USB drive, use the icon option. Set it to the name of the icon file.

Note: Since drive letters can change for USB drives, the file path is relative to the root of the drive. This means that if your USB drive is presently mounted on U: and your icon is located at U:\Icons\MyIcon.ico, then you would enter \Icons\MyIcon.ico for the value of this option.

For example, if you had an icon on the root of the USB drive called coffeecup.ico and you wanted this to be the icon that showed up for the USB drive, you would enter:

icon=coffeecup.ico

You are not limited to .ico files. If, for example, you have an executable with a nice icon, you can specify it as the icon file. For example:

icon=DCoTopen.exe

This is valid as long as DCoTopen.exe is available on the root of the USB drive.

Some files have more than one icon embedded in them. If this is the case, you can select which icon to use by specifing the index number after the file name. For example:

icon=iconlib.dll,2

This will use the second icon in the iconlib.dll file.

Naming Your USB Drive

If you would like your USB drive to display a specific name othr than the drive label created when it is formatted, use the label option. For example, if I wanted to call my drive DCoT Drive, I would add this to my autorun.inf file:

label=DCoT Drive

Now, when you look at your USB drive in My Computer, it will say DCoT Drive by the drive letter.

Setting AutoPlay Options

AutoPlay is a relatively new function of Windows XP. It allows you to set up what file is run when the USB drive is plugged into the computer and the message that you are prompted with. There are two options that work in conjunction with AutoPlay. The first is open. It specifies the program that you can run automatically with AutoPlay. So, if we wanted to run a program called DCoTopen.exe, you would add the this to your autorun.inf file:

open=DCoTopen.exe

The second option that we add is the message the user is prompted with. To set this, we use the action option. If we want the message to say DCoT Open Program, add the following to autorun.inf:

action=DCoT Open Program

Once you have added this information, AutoPlay should look something like this:

AutoPlay

Adding Context Menu Items

There are certain basic options such as Open and Explore that are available when you right click on a USB drive. But, wouldn’t it be cool to add your own? You can using a couple of lines in the autorun.inf file.

The first thing that we need to do is create an action, give it a name, and a message. We do all of this using the shell\verb option. For example, let’s say that we would like to create an action called lost. It does not matter what the actin is called. It can be anything you want. We would also like to show the message Help! I’m Lost! in the context menu. We would simply add this line to autorun.inf:

shell\lost=Help! I'm Lost!

This will display Help! I’m Lost! in the context menu so that you can click on it. But, it doesn’t know what to do when you click on it. Tell the system by using shell\verb\command option. In our example, we want to run the Lost.exe application. Adding this line will do the trick:

shell\lost\command=Lost.exe

You can add as many of these line pairs as you want to make the context menu as custom as you want.

Changing Default Action

When you double click on your USB drive, by default it will open up the drive so that you can browse through the files. Often, it is advantageous to perform some other action when the user double clicks the USB drive icon. You do this with the shell option. If we wanted to run the Lost.exe program from the previous section automatically when we double clicked on the USB drive, we would add this line:

shell=lost

because lost is the name of the action that was specified in the earlier lines.

Viewing a File

If you wanted to view a file on your USB drive in the default application instead of running a program on the drive, you can substitute the open option for the shellexecute option. For example, if you wanted to open up a website called, oh, I don’t know, say http://www.DailyCupOfTech.com in the default web browser, you could user the following:

shellexecute=http://www.DailyCupOfTech.com

This will work for any file. This is the equivalent of using Start - Run… and then typing in a file name and clicking OK.

School’s Out, Time To Play!

That is about all there is to customizing the autorun.ing file. Now that you know what you are doing, it’s time to start playing! I have created the Autorun Dabbler’s Toolkit that you can play with.

Download the zip file and extract the contents to the root of an empty USB drive. You can now edit the autorun.inf and get it to do different things. Have fun!

Tuesday, February 26, 2008

Speed Up Your PC

5 ways to speed up your PC


By following a few simple guidelines, you can maintain your computer and keep it running smoothly. This article discusses how to use the tools available in Windows XP Service Pack 2 (SP2) and Windows Vista to more efficiently maintain your computer and safeguard your privacy when you're online.

On This Page

Free up disk space

By freeing disk space, you can improve the performance of your computer. The Disk Cleanup tool helps you free up space on your hard disk. The utility identifies files that you can safely delete, and then enables you to choose whether you want to delete some or all of the identified files.
Use Disk Cleanup to:

Remove temporary Internet files.

Remove downloaded program files (such as Microsoft ActiveX controls and Java applets).

Empty the Recycle Bin.

Remove Windows temporary files.

Remove optional Windows components that you don't use.

Remove installed programs that you no longer use.

Tip: Typically, temporary Internet files take the most amount of space because the browser caches each page you visit for faster access later.

To use Disk Cleanup

1.

Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Disk Cleanup. If several drives are available, you might be prompted to specify which drive you want to clean.

Image of Disk Cleanup dialog box

2.

In the Disk Cleanup for dialog box, scroll through the content of the Files to delete list.

Image of Disk Cleanup for dialog box

Choose the files that you want to delete.

3.

Clear the check boxes for files that you don't want to delete, and then click OK.

4.

When prompted to confirm that you want to delete the specified files, click Yes.

After a few minutes, the process completes and the Disk Cleanup dialog box closes, leaving your computer cleaner and performing better.

Speed up access to data

Disk fragmentation slows the overall performance of your system. When files are fragmented, the computer must search the hard disk when the file is opened to piece it back together. The response time can be significantly longer.

Disk Defragmenter is a Windows utility that consolidates fragmented files and folders on your computer's hard disk so that each occupies a single space on the disk. With your files stored neatly end-to-end, without fragmentation, reading and writing to the disk speeds up.

When to run Disk Defragmenter
In addition to running Disk Defragmenter at regular intervals—monthly is optimal—there are other times you should run it too, such as when:

You add a large number of files.

Your free disk space totals 15 percent or less.

You install new programs or a new version of Windows.

To use Disk Defragmenter:

1.

Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Disk Defragmenter.

Image of the Disk Defragmenter dialog box

Click Analyze to start the Disk Defragmenter.

2.

In the Disk Defragmenter dialog box, click the drives that you want to defragment, and then click the Analyze button. After the disk is analyzed, a dialog box appears, letting you know whether you should defragment the analyzed drives.

Tip: You should analyze a volume before defragmenting it to get an estimate of how long the defragmentation process will take.

3.

To defragment the selected drive or drives, click the Defragment button. Note: In Windows Vista, there is no graphical user interface to demonstrate the progress—but your hard drive is still being defragmented.

After the defragmentation is complete, Disk Defragmenter displays the results.

4.

To display detailed information about the defragmented disk or partition, click View Report.

5.

To close the View Report dialog box, click Close.

6.

To close the Disk Defragmenter utility, click the Close button on the title bar of the window.

Detect and repair disk errors

In addition to running Disk Cleanup and Disk Defragmenter to optimize the performance of your computer, you can check the integrity of the files stored on your hard disk by running the Error Checking utility.

As you use your hard drive, it can develop bad sectors. Bad sectors slow down hard disk performance and sometimes make data writing (such as file saving) difficult, or even impossible. The Error Checking utility scans the hard drive for bad sectors, and scans for file system errors to see whether certain files or folders are misplaced.

If you use your computer daily, you should run this utility once a week to help prevent data loss.

To run the Error Checking utility:

1.

Close all open files.

2.

Click Start, and then click My Computer.

3.

In the My Computer window, right-click the hard disk you want to search for bad sectors, and then click Properties.

4.

In the Properties dialog box, click the Tools tab.

5.

Click the Check Now button.

6.

In the Check Disk dialog box, select the Scan for and attempt recovery of bad sectors check box, and then click Start.

Image of Check Disk dialog box

7.

If bad sectors are found, choose to fix them.

Tip: Only select the "Automatically fix file system errors" check box if you think that your disk contains bad sectors.

Protect your computer against spyware

Spyware collects personal information without letting you know and without asking for permission. From the Web sites you visit to usernames and passwords, spyware can put you and your confidential information at risk. In addition to privacy concerns, spyware can hamper your computer's performance. To combat spyware, you might want to consider using Microsoft Windows Defender, which is included in Windows Vista, and is available as a free download for Microsoft XP SP2. Alternatively, there are other free anti-spyware software programs available.

Learn all about ReadyBoost

If you're using Windows Vista, you can use ReadyBoost to speed up your system. A new concept in adding memory to a system, it allows you to use non-volatile flash memory—like a USB flash drive or a memory card—to improve performance without having to add additional memory.



This articl is From Microsoft.