Main

How To... Archives

March 25, 2007

How to: Automatically Defragment Drives Other Than C: on Separate Schedules

When Vista is set up, the disk defragmentation task is set to automatically defrag all the drives in the system.  This isn't a bad thing, but what if you want to get a little more control over the defrag process -- for instance, defrag one drive at full speed on one day, and defrag another drive in idle speed on another day?

In this little tutorial I'll show you exactly how to do that in Vista, which will also serve as a quick primer in how to create a scheduled task in Vista.  The process of creating a scheduled task is a little different than it used to be, but there are that many more options that can be set because of this.

Continue reading "How to: Automatically Defragment Drives Other Than C: on Separate Schedules" »

April 3, 2007

What To Do When USB Devices Stop Responding

One common gripe I hear about Windows (XP mostly; I am not sure if this happens to Vista as much) is how sometimes a USB device will no longer be recognized by the system when you plug it in.  This is generally due to a problem with the hardware manifest or the "device tree" in Windows, and there's a fairly simple solution.

  1. Unplug all the USB devices that don't absolutely have to be there (i.e., your mouse and keyboard can stay).
  2. Boot Windows in Safe Mode.
  3. Open the Device Manager and look for everything in the USB Devices or Universal Serial Bus Controllers category.
  4. Delete everything in that category.
  5. Shut down and reboot the system normally.  Windows will then re-install the USB controllers.
  6. Re-add your USB devices.  They should be recognized properly, although you may need to provide drivers for them if Windows can't find them in its own driver repository.

There are other methods which I'll go into separately after I do some more research, but this one tends to be pretty foolproof.

June 27, 2007

Quick and Dirty Program Files Directory Work in Vista

An oft-raised complaint about Vista is that if you want to do any detailed work in the Program Files directory (such as deleting or moving things around), you get bombarded with UAC prompts.  Here's one way to work around that: create a shortcut that opens an elevated instance of Explorer, which you can then place in your Quick Launch or Start menu as needed.

  1. Right-click somewhere (on the Desktop is fine) and select New | Shortcut.
  2. In the item location text box, type %SystemRoot%\explorer.exae "c:\program files"
  3. Click Next.  Type a descriptive name, like Program Files (Admin).
  4. Click Finish.
  5. Right-click on the new shortcut and select Properties.
  6. In the Shortcut tab, click Advanced.
  7. Check the Run As Administrator box and click OK.
  8. Click OK to close the main Properties dialog.

That's all there is to it.  Run it, and you'll get one UAC confirmation, and then an Explorer window that opens directly onto the Program Files directory.  From there on you can do everything you need without being pestered repeatedly.  (If you want to use another directory name, just substitute it for Program Files in step 2.)

(Note: I generally have the Explorer option "Launch folder windows in a separate process" turned on.  I don't think that should affect the behavior of this tip, though.)

(Note #2: This is also a great way to do a lot of work in the Control Panel -- for instance, in the network configuration section -- without being interrupted. Just remember to close that instance of Explorer when you're done.)

(Note #3: If you already have other instances of Explorer open, or a "lingering" instance of Explorer.exe open in the Task Manager [one without an attendant window], close those first!)

June 30, 2007

So What's All That Bashing? (Again)

Not long ago I posted about using the Reliability and Performance Monitor tool to figure out where all that disk-bashing was coming from in Vista.  After some feedback from people "in the wild" and some work on my own, I've found the two biggest sources of unexpected disk activity are:

  1. The defrag application running in the background, and
  2. Volume Shadow Services.

The latter is the one most people are not immediately aware of.  I've noticed that VSS kicks in on a notebook when you bring it up out of hibernation or sleep mode, and it's been off for a long enough period of time that a new shadow copy repository is about due to be created.  When this happens, you see a lot of disk activity that doesn't seem to be related to anything -- and, as I've found, if you start doing regular work with the computer, it doesn't seem to affect performance very much, since VSS runs at a lower I/O priority than most other things.  (The same goes for defrag.)

Here's how I figured it out: the next time I fired up my notebook and saw the disk bashing, I used the R&PM to single out disk activity and sort it by writes, and looked at the File column.  Sure enough, the file in question was one of the shadow-copy repositories (found in the hidden C:\System Volume Information directory).  You could turn off System Restore to prevent this behavior, but to me, that's kind of self-defeating -- especially since System Restore and shadow copies have saved my bacon more than a few times.

As it turns out, the scheduling for how System Restore runs is now controlled in Vista by -- you guessed it -- the Task Scheduler.  A default task is created for creating System Restore points, and I'm going to look into seeing if there's some way to tweak how it's triggered so that it works better with my particular habits.

August 7, 2007

Dealing With Vista's Not-So-Secret Garbage Dump

[Note: An earlier version of this tip had some inaccuracies which were brought to my attention.  Thanks to Ed Bott for his keen eye!]

[Note #2: Ed's published a blog entry about this issue, and some additional notes that are well worth reading -- including a super-useful link to a tip on how to customize the way the Disk Cleanup tool runs.]

This is actually not an indictment of Vista alone, but something I've seen in Windows for quite some time now: the user profile \TEMP directory.  It fills up with the most amazing amount of trash imaginable, and over time it can cause programs to malfunction left and right in ways that defy analysis.

Vista does have a way to deal with it: the Disk Cleanup tool. which purges the \TEMP directory on demand.  However, as a safety measure, it doesn't delete anything newer than one week -- for instance, temporary files created as part of a program's installation process.

If you want to manually purge the \TEMP directory without the date cutoff restriction -- just blast everything in there -- here's one way to do it.  Copy the following into a text file with a .BAT extension:

rd /s /q "%localappdata%\temp" && md "%localappdata%\temp"

(That's all one line, by the way.)

When run, it'll erase the entire contents of the TEMP directory and then recreate it anew.

Two caveats:

  1. If there are any files that are in use in the directory, they will not be deleted.
  2. As hinted above, do not run this command when you're in the process of installing software, such as before a reboot to finalize a program installation.  It may delete components of the installer that are needed after the reboot.  (Note that if you attempted to install a program and the installer failed and left garbage in the \TEMP directory, it might not be a bad idea to purge all of that before attempting to re-run the installation.  Just make sure the installer is not actually running before attempting this!)

About How To...

This page contains an archive of all entries posted to Windows Insight in the How To... category. They are listed from oldest to newest.

Whatever Happened To ... is the next category.

Many more can be found on the main index page or by looking through the archives.

Sponsors

Powered by
Movable Type 4.1