Articles marked as "windows" :


Easily Create Screenshots with the Windows Snipping Tool
[ 23 May 2011 ]
Marked under multimedia, windows.

Many people find they need to create clean screenshots for various purposes. For example, I do it all the time for this blog. Others may do it for instruction manuals, or just to share something on the screen with someone else. Windows comes with a built-in tool to easily take screenshots. Here’s how you can use this tool, the Windows Snipping Tool.

First, open up the Snipping Tool. Go to Start > All Programs > Accessories > Snipping Tool

The tool will pop up and have a few different buttons.

The dropdown arrow on the New button will allow you to pick a certain type of capture.

As an example, here’s a Rectangular snip on my website. Just click, drag the box, and drop.

Now the snip will show in the save box. Here you can save it, email it, copy it, or make a new snip.

Auto Dim Your Screen at Night with F.lux
[ 20 May 2011 ]
Marked under general, windows.

Do you use your computer throughout the day and at night? One thing you may not know is that the brightness of the screen at night can affect how you sleep. To help your body adjust to a more dim environment you can use a free tool called f.lux to auto-dim your screen at night.

First, download f.lux for free. Once you’re finished installing, it will run and determine your location. Based on your location it will know what time it is and it will adjust the brightness of your screen depending on the time of day. The brightness will not drastically change in an instant. The change is gradual over time so your eyes get used to the change as it becomes later in the day.

You can see the brightness level based on the time of the day:

You can also disable it if you need full color:

Create PDFs for Free
[ 18 May 2011 ]
Marked under windows.

PDFs are one of the most commonly used file types these days. If you ever need to convert something to a PDF you can use the free CutePDF Writer. It will allow you to print anything to a PDF file.

First, download CutePDF for FREE. When you install it, it will say it requires another tool. Let it download the other tool and install for you. Also remember to NOT allow it to install the Ask Toolbar. Once it is installed, open any document or other file and try to print it. In the print options choose CutePDF Writer and it will allow you to save the file as a PDF.

    Save SSH Login Profiles with PuTTY
    [ 16 May 2011 ]
    Marked under security, time savers, windows.

    If you use PuTTY a lot for your SSH uses, you may find yourself continually typing in the same credentials a lot to log in. This is a handy guide on how to set up profiles for your logins and even call them right from application shortcuts.

    First, create a profile be entering in a Host Name and a Saved Session name. Then click Save:

     

    Now close PuTTY and create a standard shortcut to it:

     

    Right-click the shortcut and go to Properties:

     

    In the Properties after the path to putty.exe and after the final double-quote (“), enter in the following: -load “YourProfileNameHere” -l yourUserName -pw yourPassWord

    Associate File Extensions With Specific Languages in Notepad++
    [ 29 July 2009 ]
    Marked under time savers, windows.

    If you use Notepad++ often, you may notice that it recognizes the type of file you open and provides nice synatx style for the language of the file. For example, it knows .js is a JavaScript file and .css is a CSS file. Each file type has its own unique style settings. There are a lot of these predefined file types, but what if Notepad++ doens’t support a file type you open often? If you want to make a custom file type use the same style of another type, just use the Style Configurator to define your own extensions.

    Add Custom User Extensions

    In Notepad++ navigate to Settings > Style Configurator…

    Choose a language on the left side that you want your own extension to match (i.e. if I want .config files to style like XML then I’d choose XML). In the User ext. field near the bottom, enter in your custom user extension without the dot in front of it (e.g. config for *.config files). Now restart Notepad++ and it will map that new extension to the style you’ve chosen.

    Enable the Administrator Account on the Vista Login Screen
    [ 24 July 2009 ]
    Marked under security, windows.

    By default, Windows Vista forces you to make your own admin account and use that at the login screen. You can, however, enable the built-in Administrator on the login. This is useful if you like to use that account (not recommended) or if you ever forget your password or get locked out of your own account. You must first be logged in as an admin to enable this so if you’re doing some risky tinkering and want a back-up plan to get back in, maybe enable this account. Just open the command prompt (Start > Run > “cmd” [enter]) and enter in the following line:

    net user administrator /active:yes

    If you ever feel the need to remove the Administrator account from the login screen, just run this command:

    net user administrator /active:no

    Copy Files at Blazing Speeds with TeraCopy
    [ 15 July 2009 ]
    Marked under multimedia, storage, time savers, windows.

    Have you ever had the tedious task of copying a friends music library or moving the entire contents of one hard drive to another? In pretty much any situation where you need to move or copy a lot of data you are burdened with a fair amount of wait time. Using Windows Explorer to move files around is quite a task and doing it on an OS like Vista can really use up your time.

    Do yourself a favor and immediately download a copy of free TeraCopy. Get yourself the portable verison so you have this time saver anywhere you go. TeraCopy will move or copy files for you but at a much faster rate than Windows Explorer and it has many other additional features. TeraCopy integrates into the Explorer shell and even has a pause/resume copying feature.

    Drag and Drop files to Copy

    Step 1. Drag 'n Drop

    Choose a Destinaion Location

    Step 2. Browse for a Destination

    That’s all there is to it — TeraCopy will copy the files to your destination and show a progress meter.

    Force Windows Explorer to Retain Folder Customizations
    [ 13 July 2009 ]
    Marked under time savers, windows.

    Have you ever customized the sort order, view style (e.g. List, Small Icons) or windows size of a folder and had those settings vanish? Then you have to go back in and change them again only to have them randomly disappear in the near future.

    This is a common problem I have with the sort order of my music folder. Sometimes I like the music to be sorted alphabetically (default); but sometimes I like to see the newest music and sort by Date modified. Unfortunately, just about every time I un-mount and re-mount my hard drive, my custom sort its gone. This is easily fixed by a simple little registry trick, so roll up your sleeves and open regedit (Start > Run > “regedit”).

    Update the Registry

    Once you’re in the Registry Editor navigate to:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell

    Right-click on the right panel and choose New > DWORD Value

    Give the new value the name BagMRU Size

    Hit enter to save the name then double-click it and choose the Base as Decimal set the value to 10000.

    Custom Sort Order

    HOWTO: Quickly Change the Desktop Icon Size in Windows
    [ 14 February 2009 ]
    Marked under time savers, windows.

    There are a lot of customizations people go through after re-installing / re-formatting Windows. One of those things is making their Desktop appear and behave to their liking. I always add My Computer (or Computer on Vista), relocate the Recycle Bin, and adjust the icons. In Vista, I like smaller icons than the default size. There’s an easy way to do this, and a hard way:

    Easy: Change Icon Size On-The-Fly

    To change your icon size, go to the Desktop, hold down Ctrl and scroll your mouse middle scroller up or down. This will increase and decrease the icon sizes respectively:

    Ctrl +

    Hard: The Tedious Method in Vista

    The other way to change the icon size is a bit harder. In Vista: Right-click the Desktop > Personalize > Windows Color and Appearance > Open classic appearance properties for more color options > Avanced… > under Item choose Icon. Now adjust the size property. Isn’t that tedious?

    Get ZoneAlarm Pro FREE (Today Only!)
    [ 18 November 2008 ]
    Marked under general, security, windows.

    Today, November 18th, is ZoneAlarm’s birthday. In celebration, they’re giving a free copy away of ZoneAlarm Pro 2009. But it’s just today! Get it while you can:

    Download FREE ZoneAlarm Pro 2009

    HOWTO: Edit the HOSTS File in Vista
    [ 11 September 2008 ]
    Marked under network, security, time savers, windows.

    Recently a reader asked how to save their HOSTS file in Vista, because it wasn’t letting them save their changes. Vista is a bit different from previous versions of Windows. Vista introduced the new User Account Control (UAC) to help protect common users from malicious activities. In doing so, UAC has also hindered productivity. Not only does it ask you to confirm everything you want to do, it blocks your access to edit the HOSTS file. Let’s fix this so you can have complete control of it.

    There are two methods to get around this problem:

    1. Turn UAC Off

    Go to Start > Control Panel. In the top right search box, enter UAC. The search will return 1 result which will let you toggle UAC on or off. Click on the result and uncheck Use UAC… This will require a reboot, but it will save you time in the future.

    2. Copy, then overwrite the HOSTS file

    Navigate to the etc folder located @ c:\windows\system32\drivers\etc\. Copy the HOSTS file to your Desktop and edit it accordingly. Make sure it’s named hosts, not hosts – Copy. Drag it into the etc folder and when you’re asked to overwrite the existing file, say yes.

    HOWTO: Run IIS and Apache on Windows
    [ 30 August 2008 ]
    Marked under time savers, windows.

    For you web developers out there using Windows, you might not know that you can run both IIS (for .NET) and Apache (typically on Linux) side-by-side on Windows. IIS comes with XP Pro and Vista, but a lot of people don’t know that you can still leverage Apache as a web server. I personally use it for PHP and MySQL, so… alas, WAMP: Windows, Apache MySQL, PHP.

    1. Download & Install WampServer 2

    First, download Wamp. Now install; a good spot is c:\wamp.

    2. Configure Apache to run on an alternate port

    By default, a web server runs on port 80. If you’re running IIS, it’s probably running on port 80 and Apache tries to as well. Let’s change it so Apache runs on port 8080.

    You’ll see the icon for WAMP is yellow (WAMP Port Conflict), meaning not all services are running. That’s because Apache is trying to use port 80, but it’s conflicting with IIS. Click on the WAMP icon and go to Apache > httpd.conf

    Scroll down and change Listen 80 to Listen 8080. Scroll down even further and change ServerName localhost:80 to ServerName localhost:8080. Those two changes will tell Apache to use port 8080. To restart WAMP, click the WAMP icon and choose Restart All Services. The icon should now look like WAMP is Running

    That’s all you really need to get things started. Don’t forget to restart the services every time you change the httpd.conf file.

    3. Additional Customizations

    Make your websites visible to others

    To allow other people on your network to see your sites running on Apache, all you need to do is it clikc the WAMP icon in the systray and click Put Online. It will restart the services and make your sites visible to others. This setting is necessary if you’re on an actual live server environment.

    Run multiple sites using different ports

    It’s possible to run multiple sites in Apache, you just need to dish out different ports to access them. Below are two blocks of config lines necessary to make two websites run on different ports:


    NameVirtualHost *:8080
    <VirtualHost *:8080>
    ServerName localhost
    DocumentRoot "
    C:/wamp/www/site1/"
    <Directory "
    C:/wamp/www/site1/">
    Options Indexes FollowSymLinks Includes
    Order Allow,Deny
    Allow from all
    </Directory>
    </VirtualHost>


    NameVirtualHost *:8081
    <VirtualHost *:8081>
    ServerName localhost
    DocumentRoot "C:/wamp/www/site2/"
    <Directory "
    C:/wamp/www/site2/">
    Options Indexes FollowSymLinks Includes
    Order Allow,Deny
    Allow from all
    </Directory>
    </VirtualHost>

    And that’s about it. Do you have any more tips? Leave them in the comments.

    HOWTO: Map a Folder to a Drive Letter
    [ 20 July 2008 ]
    Marked under time savers, windows.

    Typically, you may map a network share to a drive letter on your machine for easy access. It usually comes in handy, but wouldn’t it be nice to do it on any folder, rather than just a network folder? You can actually do it with the subst command.

    Use the following command in the command prompt:

    subst letter: c:\folder\path

    Replace “letter:” with an available drive letter. Here’s an example of mapping my music folder to the M:\ drive:

    subst m: C:\Users\Mark\Music

    Now, if you want to remove the drive letter mapping, issue the following command on the drive letter:

    subst letter: /d

    For example, to remove the mapping for my M:\ drive, I would do:

    subst m: /d

    HOWTO: Restore the Shut Down Button in Vista
    [ 22 May 2008 ]
    Marked under time savers, windows.

    By default, Windows Vista doesn’t have the standard Shut Down button in the Start menu. In order to shut down, you need to click the right arrow and choose Shut Down. This is a bit inconvenient, however, we can easily restore the Shut Down button in place of the default Sleep/Hibernate button.

    Let’s get rid of this one:
    No Shut Down?

    Navigate to your Control Panel and choose Power Options.

    Under your current power setting, click the Change plan settings link:
    Change plan settings

    In the plan settings menu, click the Change advanced power settings link:
    Change advanced power settings

    Scroll down to Power buttons and lid. In the Start menu power button, choose the Shut down option:Change button type

    Apply these changes and your standard Shut Down button should be in place of the previous sleep button:
    Shut Down button restored

    HOWTO: Turn ClearType Font Rendering On
    [ 26 February 2008 ]
    Marked under windows.

    ClearType font rendering in Windows adds a nice shadow to screen fonts. You may notice your desktop fonts have (or don’t have) this shadow:

    No ClearType:
    Without ClearType enabled

    With ClearType:
    With ClearType enabled

    If you want to enable or disable it, go to Display Properties > Appearance.

    Appearance

    Then click the Effects button and choose your option under the second drop-down menu.

    Effects

    HOWTO: Detect Behind The Scenes Changes to Your OS
    [ 10 October 2007 ]
    Marked under security, windows.

    We’ve all done it. We start with a fresh copy of our OS, and as time goes on, we install stuff. Lot’s of stuff. At one point, we start installing junk and realize we didn’t need it, so we uninstall. And by uninstallling, we assume – or hope – that everything that we put there, is now gone. Unfortunately, that’s not always the case. This issue of behind-the-scenes changes to your OS can be solved with Tiny Watcher. Tiny Watcher, upon installation, will scan the current state of your computer. It will figure out what is running at startup, it will scan your registry and a bunch of other system files.

    On every boot after install, Tiny Watcher will scan your system for any changes since the previous scan. If it detects any changes, it will alert you and give you options for handling those changes. This program is excellent to have if you often tryout new software, but are very willing to let it go if you don’t want it. If you are afraid new software will load a bunch of useless crap deep into your machine, Tiny Watcher has your back.

    Benefits of Tiny Watcher:
    - its a small program and runs fast
    - detects most changes to your system
    - it can be configured
    - it’s free

    Registry Check

    System File Check

    HOWTO: Quickly Scan For Malware with HijackThis
    [ 3 September 2007 ]
    Marked under security, windows.

    HijackThis, a stand-alone free ware malware scanner, has been around for a long time. It’s one of those programs you can throw on a thumb drive and use to scan infected computers (you know, like your mom’s computer). I’ve been using HijackThis for over 4 years now. HijackThis is excellent for many reasons: it’s free, it’s small and a stand-alone file, it scans very fast, and it’s widely used — so many people are familiar with using it and analyzing results.

    Download it for Free

    HijackThis is now owned by TrendMicro (the very popular anti-virus company), but it is still free to download. As of the time of writing this article, there’s the standard 1.99.1 version and the 2.0 beta version. Go ahead and download one of them.

    Since you will want to use this more than once, let’s keep it someplace for future use. Extract the hijackthis.exe file and put it somewhere like C:\Program Files\HijackThis\ — the reason for having it’s own folder is that it creates backups of files you remove, in the event that you need to restore them.

    Run a Scan

    Once you have it stored somewhere, open the executable and run a scan. It will scan your registry, startup items, any BHOs (Browser Helper Object), browser start pages, system .ini files, the HOSTS file, and more. It also does this… in a matter of seconds.

    Scan Results

    Now you can see a list of items the scan came across. Many of these items in the list are actually good. For example, it will report all of your startup items, and it’s up to you to choose which ones are bad and need to be fixed. Fortunately, you have lots of help choosing what to fix. When the scan is complete, choose Save Log and save the log file to your Desktop. Keep HJT open though!

    HijackThis after running a scan

    Analyze the Scan

    Go to the website hijackthis.de to upload your scan results. Browse to your your log file on your Desktop and let the site analyze it. It will direct you to a page explaining the severity and level of safety of each item in the log. From here, you can better see what items are harmful and what’s good. Now go back into HJT and check the items you want to fix and click Fix Checked.

    That’s all there is to it. If you happen to remove something you need back, HJT stores backups wherever the .exe is located.

    HOWTO: Make the Volume Control Always Show in the System Tray
    [ 29 August 2007 ]
    Marked under time savers, windows.

    Recently I reformatted my computer so I could write an article about partitioning a hard for the OS and data. After installing my fresh copy of XP (yeah, I’m not downgrading to Vista), I noticed my Volume Control icon in the system tray wasn’t showing. This reminded me of a past experience with this issue. It turns out that some people doesn’t see the icon in the system tray, even if the option to show it is in fact enabled in the control panel:

    Sounds and Audio Devices in the Control Panel

    (click image to enlarge)

    There’s an easy solution to this problem. The Volume Control icon is controlled by systray.exe, so you just need to add that program to your registry startup folder. Note: do not make a shortcut to systray and put it in your Start Menu startup folder; it won’t help.

    Download the .reg file

    Download the .reg file and run it to automatically add the key to your registry.

    …or…

    Manual Method

    If you want to manually modify the registry, here’s how. Open regedit (Start > Run > regedit) and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

    Right-click in the right-side and choose New > String Value.

    New > String Value

    Give it a simple name, like Systray. For the value, enter “C:\WINDOWS\system32\systray.exe”

    The new value in the Registry

    HOWTO: Sort a Folder by Date Created
    [ 27 August 2007 ]
    Marked under time savers, windows.

    I often find myself browsing through my external hard drive through my music. I always looks for the latest songs I’ve downloaded but I tend to forget what’s new. I find the easiest way to find my new stuff is to sort by Date Created, however, the right-click Arrange Icons By menu doesn’t offer Date Created by default:

    No ‘Date Created’ sorting by default

    It’s easy to add this to the menu though. Just go to View > Choose Details … and check Date Created:

    Choose Details…

    Date Created

    Now when you right-click in the folder, you can choose Arrange Icons By > Created:

    Arrange  Icons By > Created

    HOWTO: Map a Folder to a Drive Letter
    [ 20 August 2007 ]
    Marked under time savers, windows.

    If you’ve used TrueCrypt before, you know you mount encrypted volumes as drive letters. Ever wonder how to mount just a regular folder as it’s own virtual drive? You can issue the subst command in the command prompt to do this.

    subst <drive letter> <path>

    Just make sure the drive letter isn’t being used. If you ever need to delete a virtual drive, just issue the following command:

    subst <drive letter> /D

    Here are some examples:

    subst M: C:\Documents and Settings\Mark\My Documents\My Music

    subst W: C:\Inetpub\wwwroot

    subst F: C:\Inetpub\ftproot

    If you want to get this job done using a GUI, go ahead and grab Visual Subst.

    HOWTO: Combine Word Docs Into One Doc
    [ 11 July 2007 ]
    Marked under time savers, windows.

    I recently ran into a slight dilemma. I downloaded some printable calendar months as Word docs, but they were each their own document by month. I wanted to put them all into one document and a simple copy-and-paste would normally have been fine. It did not work because they contained highly formatted tables and they just didn’t copy over correctly. Fortunately, Word can easily add files together.

    First, click on the line you want the other Word doc to be pasted to. Then, go to Insert > File and select your other Word doc. That’s it. It will be inserted into the doc you’re in at the spot where you left the cursor.

    Insert a file

    HOWTO: Fast File Tranfers On Your Home Network with FTP
    [ 7 June 2007 ]
    Marked under multimedia, storage, time savers, windows.

    We’ve all done it… we’ve had to transfer some files to a computer just feet away, but we’ve had to do extra work to get the job done. There are plenty of ways to get stuff to another computer on your network – email, external media (thumb drives, external HDDs), web space, direct connections (like in IM), etc. Many of those methods are really great, but by using FTP, we can take advantage of local transfers over our own network.

    Note: This requires Windows XP Professional

    In a nutshell: install the FTP service in Windows on at least one of the computers (best if all have it); make anonymous FTP connections allowed; FTP to your internal IP address from one computer to the other. And….done.

    In detail:

    1. Install the FTP server

    You need your Windows XP Pro installation CD to install this extra Windows component, so load up the CD and go to the Control Panel in Windows. Open Add or Remove Programs and select Add/Remove Windows Components from the left side.

    Add/Remove Windows Components

    (click to enlarge image)

    Put a check mark next to Internet Information Services (IIS) and click the Details… button.

    IIS

    (click to enlarge image)

    Put a check mark next to File Transfer Protocol (FTP) Service. Common Files and the Snap-In will automatically become selected. Click OK and Next and finish up the installation.

    FTP

    (click to enlarge image)

    2. Set up anonymous FTP and an ftproot

    Open up Administrative Services (can be found in the Control Panel). From there, open up IIS. Expand FTP Sites and right-click on Default FTP Site, and hit Properties.

    Default FTP Site Properties

    (click to enlarge image)

    Under the Security Accounts tab, make sure Allow Anonymous Connections is checked.

    Allow Anonymous Connectons

    (click to enlarge image)

    Under the Home Directory tab, make sure Read and Write are both checked. At the top, choose a path to your ftproot, or keep the default (C:\Inetpub\ftproot). Mine is set to C:\dropbox\.

    Set the ftproot path and Write permission

    (click to enlarge image)

    3. Transfer files in an FTP client

    Load up your favorite FTP client and connect to your local IP address of the computer your sending data to. For example, say my local IP is 192.168.1.4 and the computer I want to send data to is 192.168.1.7. In my FTP client, I would enter 192.168.1.7 for the server and connect. The file transfer should be really quick since you’re on the same network. The data is not going over the Internet but is actually just going through your router from one connected client to another. So, the real bottleneck of the transfer is the router itself.

    4. Q & A

    Q: Why do you only need one (of two) computers to transfer files?
    A
    : Say you want to transfer files to and from two computers. You have PC1 and PC2. If you set up the FTP server on PC2, it’s possible to transfer data in both directions – to and from PC1. To send data to PC2, connect to its IP from PC1 and send your files over. Easy. Say you want something from PC2 to go to PC1. Just copy the file(s) into the ftproot on PC2, and when you connect from PC1, just drag the files from PC2 to your own local file system.

    Q: Can I set up the FTP service using Windows XP Home?
    A
    : No. However, you might be able to get it to work. Read these instructions.

    Q: Can I make FTP access NOT anonymous?
    A
    : Yes, just make sure the Allow Anonymous Connections option is not checked. You can manage permissions below it.

    HOWTO: Defrag Files, Folders, or Drives Very Fast
    [ 28 May 2007 ]
    Marked under time savers, windows.

    WARNING: Tested on XP only

    I’ve written about a Sysinternals program in the past, and this time I’m going to introduce you to Contig. Contig is a simple program that can defragment files very quickly. The only drawback is that it’s a command-line program. Well…say welcome to Power Defragmenter GUI. PDG is a GUI wrapper for the Contig program.

    1. Download

    Go ahead and download Power Defragmenter GUI from Softpedia. Installation is just a matter of unzipping the folder to some location you want (I’d put it in C:\Program Files\Power Defragmenter GUI\).

    2. Run

    Now, run the program (Power Defragmenter, not Contig).

    Select what you want to defrag, like a single file, a folder, or an entire disk:

    Select what to defrag

    3. Wait

    Now just wait some time for the program to defrag your files. You’ll see the Contig running in a command prompt. It will be really fast, so don’t get a seizure.

    Do you have any tips for defragging?

    HOWTO: Keep Your Desktop Clean yet Maintain Quick Access to Programs
    [ 21 May 2007 ]
    Marked under time savers, windows.

    More often than not, I see Desktops litered with shortcuts to programs, folders, documents and files. Honestly, do you really use each of those programs on your Desktop every time you’re on your computer? You can actually clean up your Desktop yet still have really quick access to your programs and files. I’m taking about the Toolbar feature of Windows Taskbar.

    1. Create a holding folder

    I created my folder called Utilities in My Documents. Then, I placed my Desktop shortcuts in this folder. Feel free to create sub-folders of categories, like, Multimedia, Networking, etc.

    A holding folder

    2. Create a toolbar

    Right-click on the Taskbar, go to Toolbars > New Toolbar …

    Create a new toolbar

    Browse to your newly created holding folder and click OK at the end. Now, just click the arrows next to the folder name on the right side of the Taskbar and your folder will expand to its contents of billions of programs you have shortcuts to but never seem to use (at least often enough).

    Browse the folder via the Taskbar

    HOWTO: Get Instant Access to the HOSTS file
    [ 1 May 2007 ]
    Marked under time savers, windows.

    The HOSTS file is a file used to map IP addresses to domains. There are many uses for it — my favorite it to block ad servers. The HOSTS file has no extension, so you can’t associate a program with it automatically to open it all the time. Instead, you can create a shortcut that calls a text editor of your choice to open it.

    Create a desktop shortcut with the following program path to open the HOSTS file in Notepad:

    notepad "c:\windows\system32\drivers\etc\hosts"

    Create a desktop shortcut with the following program path to open the HOSTS file in WordPad:

    "c:\program files\windows nt\accessories\wordpad.exe" "c:\windows\system32\drivers\etc\hosts"

    If you want to auto-open it in any other editor, just change the first path to the program editor’s main executable.

    Once you have your shorcut, rename it to hosts and drop it in C:\windows\ so you can run it from the Run box by entering in hosts and hitting enter.

    Watch a screen cast of it right now:

    Utility Center: 4 New Additions
    [ 9 April 2007 ]
    Marked under general, mobile, multimedia, time savers, windows.

    Here are a few new additions to the new Utility Center.

    IrfanView – this program goes back to my days with Windows 95. This is an excellent image viewer…a perfect replacement to the default view in Windows. You can open plenty of different image formats as well as play audio formats. This program has been written about before for ability to take great screenshots.

    FileZilla – this is a very reliable FTP program — and it’s completely free. I highly recommend it for any FTP use. It has n account manager that lets you save passwords and addresses.

    CleanUp! – this program has been mentioned in the past as a good way to clean up your hard drive. It can scan though a lot of common areas looking for temporary files, cached files and other junk. This is definitely a good program to have.

    BitPim – this program is a great one for cell phones. If you are able to connect your phone to your computer (either hard wire or wireless), you can use the bad boy to transfer media over to the phone. It’s been mentioned in the past in a detailed tutorial on putting MP3s on the LG Chocolate as ringtones.

    HOWTO: Change the Administrator password in Windows XP
    [ 21 March 2007 ]
    Marked under security, time savers, windows.

    You should probably know that it’s quite important to create a password for the “Administrator” account in Windows. By default, this user does not have a password. To keep your PC safe, you should add a password to this account. Through the normal setup process though, you will probably create your own user account first, which will probably be an Administrator itself. Now, rather than figuring out how to get into the main ‘Administrator’ account*, why not just change the password from your own account? There are two very easy ways to do this… if you’re a loyal reader, you will know the second one.
    1. User Accounts Panel

    Go to the Run box and enter control userpasswords2 (make sure there’s a 2 at the end). At the bottom, click Reset Password… under the Administrator section. Enter a new password twice. Dunskie.

    …OR…

    2. ‘net user’ command

    You can refer to an old post to get the details for this one. Just enter net user Administrator <your new password here> in the command prompt. Voila.

    * To get into the Administrator account, reboot your machine and boot into Safe Mode. On the user account selection screen, you should see the Administrator account listed.

    HOWTO: Enable/Disable the HOSTS File On-The-Fly
    [ 1 March 2007 ]
    Marked under time savers, windows.

    If you use my previosuly featured method of blocking websites using the HOSTS file, then you probably know it’s annoying to navigate to that file to disable it. Why would you want to disable it you may ask? Well, let’s say you go to a website numerous times and you’re unable to reach it. Other people can see it, but you claim the site is down. Maybe you’re blocking it in the HOSTS file. Well, disabling it is one way to find out. Instead of finding the file and renaming it to disable the blocking, you can run this simple script I wrote. It will enable/disable the HOSTS file and tell you what state the file is in. Toss it in your system32 directory and you can run it from the Run box. The script renames hosts to hosts1 and vice versa

    You can download the file (hosts.bat) or you can just copy the script below:

    @echo off
    cls

    cd C:\WINDOWS\system32\drivers\etc

    if exist hosts goto two

    :o ne
    ren hosts1 hosts
    echo.
    echo hosts ENABLED
    echo.
    goto end

    :two
    ren hosts hosts1
    echo.
    echo hosts DISABLED
    echo.
    goto end

    :end
    pause

    HOSTS script
    Disable/Enable via the Run box.

    hosts DISABLED

    hosts ENABLED

    HOWTO: Free Up Precious Space in Windows
    [ 20 February 2007 ]
    Marked under storage, time savers, windows.

    Notice your hard drive getting pretty full? Isn’t it a hassle to go through the whole workflow of deleting Temporary Internet Files, clearing your Cache, removing unnecessary backup files, etc.? We’ll, luckily there’s an excellent program out there for you. To top things off, it’s completely free. CleanUp! is an excellent program to free up some space on your hard drive. It works by scanning your drive and deleting the common space-takers, like your Firefox Cache, IE’s Temporary Internet Files, your cookie text files, as well as standard temp files and even your prefetch files *. It’s just a simple download and install and you’re on your way to more free space.

    Once CleanUp! is installed, you will notice two CleanUp! shortcuts, the normal version and the demo mode:

    cleanup1.jpg

    Running the demo will scan your drive and pretend to clean it up, but it won’t actually remove any files. This is good to see how much space it might save you without doing it permanently. Try this is you are wary of removing so many files; you can always check out the log to see what files were deleted:

    Demo Message
    (click image to enlarge)

    Once you run the normal mode of CleanUp!, you can choose some options to customize the scan. Just select the Options menu:

    Main Menu
    (click image to enlarge)

    As you can see above, after 6 scans, I’ve cleared up 956 MBs.

    In the options menu, you can select what you want to be removed from your machine. I prefer the Standard settings, but you can customize it to your liking. If you are ever unsure, just run it in demo mode.

    cleanup4.jpg

    Go ahead and download CleanUp! now to start freeing up some space.

    Turn your speakers on too before you run the scan — it’s pretty amusing.

    * – After reading the comment below and doing some research, it appears the Prefetcher caps itself to a limit so the .pf files don’t take up a lot of space. Not to mention that fact that these files are just re-created anyways, so it’s just a waste of time to remove them.

    HOWTO: Quickly Shut Down or Restart in Windows XP
    [ 12 February 2007 ]
    Marked under time savers, windows.

    If you ever want to quickly Shut Down or Restart Windows XP, you can use Alt + F4 do get the job done. Alt + F4 is usually the “Exit” keyboard shortcut to exit the current program. However, if you’re on your Desktop, hitting Alt + F4 will actually prompt you to Stand By, Turn Off, or Restart your computer. Say, you have a program running and want to Restart, just hit the Windows Key + D (to go to the Desktop), then hit Alt + F4 to launch the prompt.

    alt-f4.jpg

    Replace Task Manager with the more powerful Process Explorer
    [ 24 December 2006 ]
    Marked under windows.

    Windows Task Manager is a very common utility for some people. Computer slow? Go to Task Manager and kill some processes. Something not responding? Go to Task Manager. I guess Task Manager is pretty good, considering it’s a built-in feature of Windows. Well, Sysinternals (which was recently acquired by Microsoft), has a replacement for Task Manager. It’s called Process Explorer. I’ve been using it for a long time and I think you should make the switch. Why?

    So… now that you’re intending to make the switch, I’ll walk you though it.

    Download
    Go ahead and download Process Explorer (1.5 Mb) for free from the Sysinternals website. Unzip the folder. Choose a good location, such as C:\Program Files\Process Explorer\.

    Play around
    Open procexp.exe and start to explore. You can explore all of the processes running on your machine. You can even see how much CPU time is being used on hardware interrupts (that’s an example of the power this utility gives you).

    pe.jpg (click to enlarge)

    Set Process Explorer to be your new Task Manager

    Go to Options > Replace Task Manager. Done.

    pe2.jpg

    Enjoy and let me know what you like/don’t like about this app. I’ve been using a bunch of the free apps from Sysinternals for years, so let me know what you think about others as well.

    HOWTO: Quickly take great screenshots
    [ 9 November 2006 ]
    Marked under multimedia, windows.

    Ever wonder how you can take good screenshots to show off menus and screens of applications? Ever wonder how I make my screenshots for most of my articles? I’ve been using this program called IrfanView since I had Windows 95 (no…seriously). IrfanView has a ton of built-in functions, including something called a Capture. In fact, the screenshot below that shows how to capture was taken using IrfanView. A screen capture is a way to “capture” what is on the screen, so it takes a screenshot (duh). In IrfanView, just go to Options > Capture/Screenshot OR click the C on your keyboard. The Capture menu will pop up:

    irfanview1small.jpg (click to enlarge)

    There are a couple of categories to select options in.

    Capture area:

    Whole screen – captures entire screen (your resolution)
    Foreground window – entire selected window
    Foreground window (client area) – window without caption, menu and status bar

    Capture method:

    Use a hot key to hit when you want to take a shot
    Automatic timer delay will take a shot after x seconds

    Capture options:

    Choose to include or mask the cursor

    Saving method:

    Show the shot in the viewer
    Automatically save the shot to a location

    More of IrfanView

    Another good thing about IrfanView is the ability to have multiple instances. I had two instances for the screenshot above, one taking a screenshot and the other with the Capture menu open. IrfanView also has the ability to add in plug-ins. You can watch movies and listen to sounds in it.

    In case you were wondering, I took a regular-sized screenshot of the Capture menu; that was too big for the site, so I used the resize option and made a second image 50% of the original size. The half-sized image is the thumbnail which links to the full-sized image.

    HOWTO: Convert movies to iPod format [for free]
    [ 7 November 2006 ]
    Marked under multimedia, windows.

    I’m sure there are many programs out there these days (free and for $) that will convert files to the iPod format. Well, here is one. It’s called 3GP Converter. It converts typical computer movies to the 3GP video wrapper. That means you can convert to many different formats, but we are only concerned with the iPod MP4 format.

    1. DOWNLOAD and UNZIP

    Download 3GP Converter and unzip the folder. No install is necessary. It might be a good idea to unzip it to a folder in Program Files (e.g. C:\Program Files\3GP Converter\).

    2. RUN INITIAL SETUP

    After everything is unzipped, run Setup.exe which will set the basic preferences for the converter. You only need to run this setup the first time you use it.
    Step 1

    You may notice the only thing you can understand is the word Japansese at the bottom left. Click it and select English to change the language to English.

    Step 2

    Now that you can actually read the formats, scroll down and select Model: MP4, for iPod. This is the format we will convert to. As you can see, there are a ton of other formats to convert to, so do what you want…if you have a PSP or a phone that supports these formats.

    3. CONVERT

    Click the apply button on the Setup panel. From now on, you just need to run the 3GP_Converter.exe program.

    Step 3

    Select an output directory by clicking Browse. You can also choose some other options using the drop-down menu, but I’ve only tried the default. Feel free to try different bit rates and whatnot and comment on your success/failure in the comments. Now, to convert a movie, just drag it onto the white area at the top. If you drag multiple movies up there, they will queue up for conversions.

    HOWTO: Instantly change your MAC address
    [ 22 October 2006 ]
    Marked under time savers, windows.

    NOTICE: Windows XP ONLY

    There’s a C++ command-line utility called Macshift that allows Windows XP users to change their MAC address to any other valid address. I’ve written about how to use it and how to create shortcuts to change your MAC address on-the-fly. I’ll first explain how to use Macshift for any MAC change, then I’ll show you how to make Windows shortcuts using the command-line options. I’ve also made a small script to make it easier to use, but the script isn’t necessary.
    Macshift usage

    Macshift is a command-only utility, so you need to learn the options to use it.

    -i [adapter name] tells what adapter in Network Cnnections to change
    -r tells the program to use a random MAC
    -d restores the original MAC
    --help shows the Help menu

    Example usage:
    macshift -i "Wireless Network Connection" 001122334455
    This would change your wireless MAC to the one above. Your adapter will be disconnected and reset immediately.

    macshift -i "Wireless Network Connection" -d
    This would restore your MAC address to the original.

    The adapter name must appear exactly as it does in your Network Connections. By default, a wired connection should be “Local Area Connection” and wireless should be “Wireless Network Connection” — you can rename these to make it easier.

    Create Windows shortcuts

    The first thing you should do is find a permanent place to keep Macshift. Make a folder in Program Files or just throw it in the Windows directory. Right-click it and choose Send to -> Desktop to make a shortcut. Now, just use the command options in the path field of the shortcut. Create as many shortcuts to the Macshift exe as you want. Below are some shortcut examples.

    Generates a random MAC.
    mac-random.jpg

    Restores the original MAC.
    mac-restore.jpg

    As you can see, I have macshift.exe in my C:\WINDOWS\ folder. All I did was add some options to the end of the path to tell it what to do. You can manually tell it what MAC to use also. Instead of using the -r option, you can put a valid MAC at the end like:
    macshift -i "Local Area Connection" 001143641222

    Use a script to specify a MAC
    I’ve written a simple script to ask you for the MAC you want to change to. Just run the script, enter your desired MAC and adapter, then hit enter. It’s pretty simple. Here it is:

    set /P newmac="Enter your desired MAC: "
    set /P adapter="Enter the adapter name: "
    macshift -i %adapter% %newmac%

    If you use this script, you need to place the macshift.exe program in a PATH folder (i.e. a folder that can be run from the command line; see the PATH variable in Environmental Variables). If you’re not sure waht that means, put macshift.exe in either C:\WINDOWS\ or C:\WINDOWS\system32. The script is very unnecessary, but if you want to use it, go for it.

    Why would you want to change your MAC address?

    You tell me. People change their MAC addresses for a number of reasons. Why do you? Let me know in the comments or by email.

    DIY: Open Command Window Here
    [ 9 October 2006 ]
    Marked under time savers, windows.

    Many people that use Windows also use the Command Prompt / Command Window / DOS Prompt (or whatever you choose to call it). I use the prompt often myself (as you can see from previous posts), so it’s important to be able to navigate through folders via the prompt. I could choose to open a prompt and use cd all the time to navigate directories, or I could use a program to open a prompt already at the folder I’m in. To go even further, I could download the Microsoft PowerToy “Open Command Window Here,” or I could write it myself. I think I’ll write it myself, seeing that it takes about two lines of Registry code.

    cmdprompt.jpg
    You have three choices: (1) make your own Registry script using the given code, (2) manually enter keys into the Registry the long way (a good way to learn though), and (3) download and run the script I already made for you.

    (1) The .reg code view

    Make your own Registry file (a .reg extension) with the following code:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd]
    @="Open Command Prompt Here"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd\command]
    @="cmd.exe /k pushd %L"

    (2) Manual Registry instructions

    1. Start > Run > “regedit” [Enter]
    2. Open HKEY_LOCAL_MACHINE/Software/Classes/Folder/shell/
    3. Right-click on Shell > New > Key
    4. Name it Command Prompt (or anything you think is descriptive for yourself)
    5. In the right frame, for the default value, of the Command Prompt key you just made, enter whatever text you want to appear in the context menu (e.g. Open Command Prompt Here -or- Commaaaaaannnd!)
    6. Back in the left frame, right-click Command Prompt (or whatever you called it) > New > Key
    7. Name this sub-key: command [Note: it must be named command to work]
    8. In the right frame of command, set the default value to cmd.exe /k pushd %L

    Screenshots of what your registry should look similar to (click images to enlarge):

    registry1.jpg

    registry2.jpg

    (3) The lazy way: download and run the .reg

    If you don’t want to do anything yourself, just download the registry file (.reg) and say OK to the warning. It will add the code to your registry for you.

    About the Registry script

    I’ve only tested this script on Windows XP Pro for my own use. Your experience may differ, so I hold no responsibility if you screw something up in your registry. This article was revisited from a previous comment of mine on Lifehacker.

    The script in a nutshell:

    The first line makes a registry key for the Windows Explorer shell. This name appears on the right-click context menu when you right-click a folder. The second line places the code that gets executed when you click the menu item. This line of code launches the command prompt (cmd.exe) in interactive mode using the /k switch. The pushd command stores the name of the current directory, and %L places that stored name into the variable spot.

    HOWTO: Securely open TrueCrypt volumes in one click (Redux)
    [ 30 September 2006 ]
    Marked under security, time savers, windows.

    In the past, I wrote an article about a very easy way to mount and explore a TrueCrypt volume in one step. Some security issues came up about keeping the volume password in the batch file used to mount. This new article take that into account. The [almost] same script is used to mount the volume, but the password is taken out and you are instead required to enter the password at a prompt. The beginning steps are the same as the previous article, so if you just want to see the new feature, skip down to the “Create a script to mount” section.

    Create your volume

    Create any size TrueCrypt volume using your encryption algorithm of choice. My computer runs the Blowfish algorithm the fastest, so that’s my typical choice. Make sure you assign a good, long, hard-to-break password to it. The only way to reveal the contents of the volume is the password. We’re talking encryption standards the government uses here. So no one’s going to break in another way — you need a good password and you must remember it.

    Copy TrueCrypt stand-alone files

    TrueCrypt comes in an installable version and an stand-alone version. You can use the stand-alone command-only version for the batch script. The stand-alone files are inside the “Setup Files” folder inside the TrueCrypt folder. First, rename truecrypt.sys to tc.sys and truecrypt-x64.sys to tc-x64.sys. This will make it more simple for us. Go ahead and copy tc.sys and tc-x64.sys to C:\WINDOWS\. This will allow us to call the TrueCrypt program in the batch script.

    Create a script to mount (NEW stuff here)

    You may download the new batch script I wrote to mount a volume. Make sure you fill in the appropriate part specific to you — the path to your volume. Place this script in C:\WINDOWS\ so you can call it from the Run box. Here’s the main line in the script which has been slightly changed from the previous version:

    tc /v <path to file> /l x /p %thepass% /q

    As I said, make sure you fill in the correct path to your file. The changed piece is the pulling of the password and the addition of the %thepass%. That will require you to enter a password through a prompt when you run the script. Your password will no longer be in the file for anyone to see.

    batch-prompt.jpg

    You may notice, I use various flags in the call. The /v flag will make TC mount a volume; then /l x will mount it as the letter X:\ (like it’s a drive); /p means the password follows it — where in this case, it causes a prompt. Finally, /q will quit the program when done. After the mounting takes place, we call explorer on the X:\ drive to open it.

    Create a script to unmount

    Following the previous script’s example, I’ve also written a script to unmount your volume. Fill in the necessary changes. Place this script in C:\WINDOWS\ so you can call it from the Run box. The only new flag I use is /dx which will dismount the X:\ drive.

    Test it out

    Time to test it all out. Hit WinKey + R > type in mount2 (or you can rename my new script to mount.bat or whatever you want) and hit Enter. Your volume should mount and should open in Windows Explorer. Now, to unmount it, in the Run box, type in unmount (or whatever you may want to rename it to) and hit Enter. Nextel. Done.

    HOWTO: Safely Eject Hardware (if Windows doesn’t let you)
    [ 11 September 2006 ]
    Marked under security, time savers, windows.

    If you’ve ever plugged a USB device into your computer, you’ve probably experienced the need to properly disable it. When you are done with the device, you are supposed to safely stop the device before you shut it down. This is to make sure nothing is accessing the device at the time of shutdown.

    eject1.jpg

    Let’s say you have an external hard-drive that you want to turn off. If you don’t properly stop it, Windows may be accessing some files at the time of shutdown, and this may cause data corruption. Sometimes when you try to shut it down though, you get an error saying the device is in use. This may happen even if you know nothing is using the device. All explorer windows are closed, and you know no programs are using it.

    eject2.jpg (click to enlarge)

    If this happens, you can use freeware Process Explorer to hunt down the thread accessing the device. Just open Process Explorer, hit Ctrl + F to open the Search menu, and enter the drive, in my case, “E:\”.

    eject3.jpg

    Now I can see a hidden instance of explorer is actually accessing the E: drive, so I just need to click on the result to see the thread. Now, right-click the thread, and close the handle.

    eject4.jpg

    Now that the hidden instance of explorer is closed, we can go about stopping the device the right way and avoid possible data corruption.

    In my experience, this happens often when I access an external drive a lot and keep opening and closing exlorer windows. Occasionally, an instance will be remain open even though I’ve closed all windows. This method is also good for other USB devices that may annoy you. Just search for the drive letter and close all handles accessing the drive.

    HOWTO: Mount and explore TrueCrypt volumes in one step
    [ 6 September 2006 ]
    Marked under security, time savers, windows.

    This article will show you how to use the power of a Windows batch script to mount a TrueCrypt volume and explore the contents as a hard drive in just one step. For those of you that don’t know, TrueCrypt is free software that you can use to encrypt files. You can create a container file (named anything you want) and mount it as a drive using the TrueCrypt software. Unmounted, it looks just like a regular file.

    Create your volume

    Create any size TrueCrypt volume using your encryption algorithm of choice. My computer runs the Blowfish algorithm the fastest, so that’s my typical choice. Make sure you assign a good, long, hard-to-break password to it. The only way to reveal the contents of the volume is the password. We’re talking encryption standards the government uses here. So no one’s going to break in another way — you need a good password and you must remember it.

    Copy TrueCrypt stand-alone files

    TrueCrypt comes in an installable version and an stand-alone version. You can use the stand-alone command-only version for the batch script. The stand-alone files are inside the “Setup Files” folder inside the TrueCrypt folder. Go ahead and copy truecrypt.sys and truecrypt-x64.sys to C:\WINDOWS\. This will allow us to call the TrueCrypt program in the batch script.

    Create a script to mount

    You may download a batch script I wrote to mount a volume. Make sure you fill in the appropriate parts specific to you. These parts are capitalized to stand out. Place this script in C:\WINDOWS\ so you can call it from the Run box. Here’s the main line in the script:

    tc /v <path to file> /l x /p <your password> /q

    Make sure you fill in the correct path to your file, and the appripriate password you’ve chosen. You may notice, I use various flags in the call. The /v flag will make TC mount a volume; then /l x will mount it as the letter X:\ (like it’s a drive); /p means the password follows it. Finally, /q will quit the program. After the mounting takes place, we call explorer on the X:\ drive to open it.

    Create a script to unmount

    Following the previous script’s example, I’ve also written a script to unmount your volume. Fill in the necessary changes. Place this script in C:\WINDOWS\ so you can call it from the Run box. The only new flag I use is /dx which will dismount the X:\ drive.

    Test it out

    Time to test it all out. Hit WinKey + R > type in mount and hit Enter. Your volume should mount and should open in Windows Explorer. Now, to unmount it, in the Run box, type in unmount and hit Enter. Nextel. Done.

    Also, you can rename the batch scripts to something only you will know, so it’s not easy to mount on your computer. For example, change mount.bat and unmount.bat to something like xy33.bat and sysz.bat. Only you will know.

    HOWTO: Change hard-drive letters and paths
    [ 31 August 2006 ]
    Marked under time savers, windows.

    I have two external hard-drives in enclosures for storage. One is my “E: drive” and the other is my “F: drive.” They get their drive letters based on when they’re mounted, so occasionally, they may show up in opposite order. This annoys me when I have a program that refers to E:\ when in that case, it’s the F:\ drive. To change the drive letters of your drive, follow these steps:

    Right click My Computer > Manage > Storage > Disk Management > right-click your drive > Change Drive Letter and Paths… > Change

    Now you can change it to something else. Pretty simple if you ask me, but not many people know the actual place to do this.

    change-letter.jpg
    (click image to enlarge)

    My most commonly used basic Windows features
    [ 29 August 2006 ]
    Marked under time savers, windows.

    Instant permenant delete

    Instead of hitting the Delete button on something, then emptying the Recycle Bin after, hold shift while you delete. Shift + Delete will instantly delete the item while bypassing the Recycle Bin.

    The Almighty Windows Key

    One of the best keyboard keys is the Windows Key. Combine this with a variety of letters, and you can do many basic things. My two most commonly used combos are WinKey + R to open the Run box, and WinKey + L to Lock the workstation.

    Here’s a list of other combos:

    WinKey + D             Minimizes windows and shows the Desktop
    WinKey + E
                Open an Explorer window
    WinKey + F             Opens the Find feature
    WinKey + L
                Locks the workstation
    WinKey + M
                Minimizes all windows
    WinKey + Shift + M     Undo minimization of windows
    WinKey + R
                Opens the Run box
    WinKey + U             Opens the Utility Manager
    WinKey + F1
                Opens Help for Windows
    WinKey + Pause/Break   Opens the system properties window
    WinKey + Tab          
    Cycles through programs in the taskbar

    Running apps from the Run box

    You can either follow a previous article I wrote about launching any apps from the Run box, or you can launch some built-in app. For example, entering calc into the Run box will launch the Calculator. If you have iTunes installed, entering itunes will automatically open it -- no need to follow my short hack. Need the Control Panel? Try this: WinKey + R > enter in the word control > hit Enter. Voila.

    Integrated shutdown (XP only! ...I think)

    If you hit the Power button on your computer, Windows XP will start the shutdown process... the proper process. On my old computers, hitting shutdown would just turn it off prematurely, casuing a scan on the next startup. Now you can hit the button and it will do the rest for you. You could also go to the Start Menu and click Shutdown.

    HOWTO: Block websites using the HOSTS file
    [ 28 August 2006 ]
    Marked under security, windows.

    Blocking ad servers and malicious websites is a tough task these days. There are so many tools out there to keep ads blocked, remove spyware, and scan for viruses. Most of this unwanted content comes from known ad servers and known malicious websites. You can harness the power of the Windows’ HOSTS file to actually block some of this stuff. I’ve been doing this for years, and I’m still surprised how well it works.

    In a nutshell

    For your version of Windows, the HOSTS file is located in

    Windows XP:
    C:\WINDOWS\system32\drivers\etc\

    Windows 2000:
    C:\WINNT\system32\drivers\etc\

    Windows 98/ME:
    C:\WINDOWS\

    It does not have an extension — it is just called hosts. The purpose of the HOSTS file is to allow you to manually enter IP addresses associated with websites, so the DNS server can quickly resolve an address. Say you know that google.com is the IP address 64.233.187.99 — you could enter that into the HOSTS file so when your machine requests google.com, it will immediatly know to go to http://64.233.187.99/. Instead, we can take known ad servers, and tell them their IP addresses are 127.0.0.1. For those of you that don’t know, 127.0.0.1 is your local machine, if you were running a server on it. So say, some ad server hosts a banner ad at http://www.adsite.com/ads/23bh3.jpg. If you redirect this server to your lcoal machine in the HOSTS file, when a website calls that hosted image from the ad server, it will try to load http://127.0.0.1/ads/23bh3.jpg. Since that folder and that image don’t exist on your computer, the image won’t show, and you’ve blocked the ad from showing on that website.

    Putting it together

    This first line of the HOSTS file should list the local IP address:

    127.0.0.1       localhost

    That tells the rest of the file, 127.0.0.1 is your local machine, like I explained above. You could also use 0.0.0.0 instead of 127.0.0.1 — either will work, but whatever you use for localhost, use below. After that, enter known ad servers and use your local IP (whichever you chose at the top). You can find maintained HOSTS files online or start to build your own. Here’s a little snippit of what my HOSTS file looks like:

    127.0.0.1       localhost
    127.0.0.1       92.132.206.rev.adknowledge.com
    127.0.0.1       a-con1.adknowledge.com
    127.0.0.1       a-lbs.adknowledge.com
    127.0.0.1       a-pwr.adknowledge.com
    127.0.0.1       a-sw1.adknowledge.com
    127.0.0.1       aa1-1.adknowledge.com
    127.0.0.1       aa1.adknowledge.com
    127.0.0.1       aa2-1.adknowledge.com
    127.0.0.1       aa2.adknowledge.com
    127.0.0.1       aa3-1.adknowledge.com

    Extra step: Windows XP/2000 only

    In XP and 2000, the DNS Client (a system service), will make your machine come to a grinding hault if your HOSTS file is too large. This service is unnecessary and can be stopped and disabled. Go to Start > Run > enter “services.msc” then hit [Enter]

    Navigate to DNS Client, right-click it, select Properties, under Start-up Type, select Manual. Click Apply. Then below that, click the Stop button. You should do this before you save a large list of servers to your HOSTS file.

    Disabling/Enabling the HOSTS blocking

    If you ever need to disable the blocking, just rename the hosts file to anything. I usually rename it to hosts.disable. After you do that, you need to restart your browser to see the changes. To enable it again, just rename it back to hosts.

    You could also write a script to do this for you. An example called disable.bat:

    cd C:\WINDOWS\system32\drivers\etc && ren hosts hosts.disable

    And another example called enable.bat:

    cd C:\WINDOWS\system32\drivers\etc && ren hosts.disable hosts

    More info about HOSTS

    To get a HOSTS file already full of servers, you may go to MVPs.org. To learn more about the HOSTS file, check this site out; it’s where I learned about it. Also, I posted this tip a while back, at Of Zen and Computing.

    HOWTO: Quickly launch apps from the Run box
    [ 26 August 2006 ]
    Marked under time savers, windows.

    This entry will show you how to satisfy either of the following:

    • Save time from navigating the Start menu by using the Run box
    • Act like a geek by running apps from the Run box, almost as if you were running them from a terminal

    So say you use a few programs very often. Let’s say… Photoshop, Dreamweaver, FileZilla, and PuTTY. Instead of launching the programs from the Start menu, or using Desktop icons (those are so 90′s), you can set up shortcuts that will launch them from the Run box.

    Make simple shortcuts
    First, make a bunch of shortcuts on your Desktop to all the programs you want to run via the Run box. Next, rename the programs to short, memorable names to enter in the Run box. For example, here are some names I use and their respective programs:

    adaware       Ad-Aware
    cleanup       CleanUp!
    cygwin        Cygwin console
    dc            DC++ (DirectConnect client)
    dw            Dreamweaver
    excel         Microsoft Excel
    fz            FileZilla (FTP client)
    hjt           HijackThis (malware removal)
    im            Trillian
    mp3tag        Mp3Tag
    mytunes       myTunes redux
    pe            Process Explorer
    ps            Adobe Photoshop
    putty         PuTTY (SSH client)
    si            StickIt (desktop notes)
    spybot        Spybot - Search & Destroy
    ssh           SSH client
    torrent       BitComet (torrent client)
    wa            Winamp
    wireless      Dell's wireless utility
    word          Microsoft Word

    Move all of these shortcuts into C:\WINDOWS\. This will allow them to be called from the Run box.

    shortcuts.jpg (click image to enlarge)
    Nextel. Done.

    Now you can run these apps from the Run box. Just hit Windows Key + R, then enter, say… fz to launch your FTP program. Now you can delete your Desktop shortcuts and be way cool.

    HOWTO: Disable Autoplay on drives
    [ 25 August 2006 ]
    Marked under windows.

    Have you ever plugged in a thumb drive or an external storage drive, and had that annoying Autoplay box come up? If you have a drive that you mount often and you know does not need to autoplay, you can disable it. You need to download Tweak UI (a Windows Powertoy).

    In Tweak UI, go to My Computer > AutoPlay > Drives, then unselect the drives in which you want to turn AutoPlay off. In my example, this would be my E: and F: drives.

    autoplay-off.jpg
    (click to enlarge)

    HOWTO: Quickly run DOS commands using /k
    [ 22 August 2006 ]
    Marked under time savers, windows.

    So I won a Windows Vista DVD over at Lifehacker for this little tip.

    When you go to the Run box and enter cmd, add a /k after it followed by your command. Best understood by example:

    cmd /k ipconfig /all

    This will open the command window and run ipconfig /all all in one shot. The /k launches cmd in interactive mode, which will then process any commands after it. Here’s another example:

    cmd /k netstat /?

    That will pull up the help contents for the netstat command in one move by entering it in the Run box.

    HOWTO: Change your XP password via the command line
    [ 21 August 2006 ]
    Marked under security, time savers, windows.

    I submitted this quick tip to Lifehacker in the past. If you feel the need to change your Windows password, you don’t need to go through any Control Panel menus and whatnot. You can change any user’s password via the command line, as long as you have administrative access. A good example of when to use this tip would be after a fresh install of XP. One of the first things you should do is lo into the default Administrator account and set a password. That requires booting into Safe Mode as Administrator, setting a password, then booting back into Normal mode as your own user. Instead, go to Start > Run > “cmd” [Enter], then enter:

    net user <username> <password>

    netuser1.jpg

    This will set the password you supplied as the password for the user you entered. You can also do:

    net user <username> *

    netuser2.jpg

    This will prompt you for a password, then have you confirm it.
    NOTE: you need administrator access to change the password via this command. However, if you are an administrator, you can change the password for any account on the machine. As you can see, this is a very powerful command, but it can also pose as a security threat.

    HOWTO: Backup using a batch script
    [ 18 August 2006 ]
    Marked under time savers, windows.

    So one day at work I wrote a batch script to do a daily backup of a directory for a website I was working on. I had a directory on my local machine with the HTML files. I got tired of copying the files and renaming the directory to the date. So, my intent was to create a way to copy that directory to a folder named by the current date on a network share using a script.

    Here’s the full script:

    for /f "tokens=2-4 delims=/ " %%g in ('date /t') do (
      set mm=%%g
      set dd=%%h
      set yy=%%i
    )


    if exist "\\path\to\network\folder\Daily Backup\%mm%-%dd%-%yy%" (
      rd /S /Q "\\path\to\network\folder\Daily Backup\%mm%-%dd%-%yy%"
    )

    xcopy "C:\Documents and Settings\Administrator\Desktop\website" "\\path\to\network\folder\Daily Backup\%mm%-%dd%-%yy%" /s /i


    And now for an explanation of how each piece works:


    for /f "tokens=2-4 delims=/ " %%g in ('date /t') do (
      set mm=%%g
      set dd=%%h
       set yy=%%i
    )

    This for loop will execute the command date /t and pull the result pieces 2 through 4 into variables. %%g means the first variable will be g, followed by h and i. Then, those results stored in %%g, %%h, and %%i are placed into mm, dd, and yy.


    if exist "\\path\to\network\folder\Daily Backup\%mm%-%dd%-%yy%" (
      rd /S /Q "\\path\to\network\folder\Daily Backup\%mm%-%dd%-%yy%"
    )

    This condition will check to see if the folder for today's backup exists. If so, that mean's you've already run the backup and we should discard it.


    xcopy "C:\Documents and Settings\Administrator\Desktop\website" "\\path\to\network\folder\Daily Backup\%mm%-%dd%-%yy%" /s /i

    This last line does the work. It uses xcopy to copy the first directory to the second. Notice the first is your local machine and the second is the network share where the variables %mm%, %dd%, and %yy% are used in the path. These are replaced with the actual values from part one.

    And that's it. Now you can backup a directory for each day and have a clean, organized repository.

    HOWTO: Set up a Windows SSH server for VNC tunneling
    [ 17 August 2006 ]
    Marked under security, windows.

    This tutorial will walk you through the steps to running a SSH server on your Windows machine and using it to create a secure tunnel through the Internet to use VNC.

    SETUP: Server

    Install the SSH server:

    1. Log into Windows with Administrative privileges
    2. If there is no password set for this user, set one in the Control Panel. *(a password is required)
    3. Create a cygwin folder in the C: drive (C:\cygwin)
    4. Download setup.exe from cygwin.com and save it to C:\cygwin
    5. Run C:\cygwin\setup.exe
    6. Install from the Internet and save to C:\cygwin\
    7. For Local Package Directory, use C:\cygwin\
    8. Select a download site from the large list.
    9. On the Select Package screen, click View once so “Full” appears.
    10. Scroll down to openssh in the package column, and click on “Skip” so an “X” will appear in column “Bin?”.
    11. After the packages have been downloaded, finish the installation
    12. Right click My Computer, Properties > Advanced > Environment Variables
    13. Under System Variables, click New, add CYGWIN as the variable name, add ntsec as the variable value
    14. Under System Variables, scroll down to Path, click Edit, add ;c:\cygwin\bin to the end of the string already in the field
    15. Open Cygwin on the desktop and type in ssh-host-config
    16. “Privilege Separation?” Yes
    17. “Create local user SSHd?” Yes
    18. “Install SSHd as a service?” Yes
    19. “CYGWIN = ” enter ntsec
    20. While in the same Cygwin window, enter net start sshd to start the SSH server
    21. If you ever need to stop the SSH server, enter net stop sshd
    22. In the Cygwin window enter mkpasswd –local > /etc/passwd to copy over the Windows user settings to Cygwin
    23. In the Cygwin window enter mkgroup –local > /etc/group to copy over the Windows group settings to Cygwin

    Test the SSH server:

    1. Enter ssh localhost in a Cygwin window
    2. Any time you SSH into a server for the first time, you will get an authenticity warning. The RSA key will be listed and it will ask you if you want to continue. Type in ‘yes‘ to continue.
    3. If you get a prompt without any errors, enter ls -lh /cygdrive/c
    4. If you see a directory listing of your C:\ drive, everything went right

    Install the VNC server:

    1. Install your VNC client of choice. Make sure you install the server portion of the client
    2. If you are given the option to “allow loopback connections” choose Yes
    3. Make sure you register the VNC Server as a system service. Various clients do this in different ways
    4. Once it’s registered as a service, it will auto-run at Windows startup as a service

    Tweak your firewall (if applicable) to allow port 22:

    1. In your firewall, open TCP port 22 for SSH use
    2. Example: in Norton Internet Security, Personal Firewall > Configure button > Advanced tab > General button > click Add. Permit to and from connections for TCP port 22. Name the rule something like SSH
    3. Example: in Windows Firewall for SP2, Start > Control Panel > Windows Firewall > Exceptions Tab > Add port > port name SSH, port 22 TCP

    Tweak your router (if applicable) to forward port 22:

    1. If you’re behind a router, forward TCP port 22 to your internal IP
    2. This means that any traffic coming in through port 22 (the SSH port) will be passed through the router and directed (forwarded) to your internal IP

    SETUP: Remote machine

    Install the SSH client and create a tunnel:

    1. Install your SSH client of choice (mine is PuTTY)
    2. Create a tunnel to your SSH server
    3. In PuTTY, click the Add button under the tunnels section
    4. Make the source port = 5900 and the destination = 127.0.0.1:5900
    5. In the SSH Secure Shell client, edit your profile and go to the Tunneling tab
    6. Make the listen port 5900, the Destination host 127.0.0.1 and the destination port 5900. Choose TCP for the type and uncheck “Allow local connections only.”

    Configure PuTTY for auto-login (if you choose to use PuTTY):

    1. Make a shortcut to putty.exe on your Desktop
    2. Right click the shortcut, Properties > Shortcut tab > Target field
    3. Add the following to the end of the string in the field: -load “[your profile name]” -l [login name] -pw [password]
    4. Example: -load “home” -l Mark -pw mypassword

    Install the VNC viewer:

    1. Find a VNC program of your choice and install the VNC Viewer portion of the package.

    EXECUTE: VNC over SSH

    1. Open your SSH client, connect to your remote IP address
    2. Open your VNC viewer, connect to 127.0.0.1:5900