DevCon: Rescan for Hardware automatically

On March 13, 2008, in Technology, by Andrew

I’ve been having a strange issue with a PCMCIA card on my wife’s computer. Every time the machine is rebooted, you are required to “Scan for Hardware Changes” in device manager. It does not automatically detect that the PCMCIA card is still plugged in. After searching google high and low for a solution, I thought about seeing if I could write a script that would automatically run a hardware scan at logon. Here is what I came up with:

  1. Download DevCon.exe from Microsoft: DevCon.exe
  2. Extract either the 32-bit or 64-bit executable to C:\Windows\System32\
  3. Create a file called: “devcon_rescan.cmd”
  4. Put the following text in it:
    @echo off
    devcon.exe /rescan
  5. Copy the file to C:\Windows\System32\
  6. Open the registry editor: Start –> Run –> regedit
  7. Go To: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  8. Create a new string value called: DevCon
  9. Right click the new value and select Modify. Type in the path to the batch file you made (i.e. “C:\WINDOWS\SYSTEM32\devcon_scan.cmd”)

Hope this helps somebody.

 

2 Responses to “DevCon: Rescan for Hardware automatically”

  1. Mike says:

    Thank you for posting this. It turns out that it’s great for Parallels users too. Virtual Machines don’t seem to do a very good job of scanning attached hardware each time the session is unpaused. This solved a problem I was having with a USB hardware key. It also solved a problem I had with a FireWire large format scanner.

  2. Alexander says:

    I have the following Problem:

    We install Win7 automaticly by WDS. But after Installation, there are Devices in the DeviceManager, that don’t have a driver installed. When i’am logged in, as an Administrator, i open to the Device Manager, just click “Scan for Hardware Changes” and it finds and installs all the devices automatically. Thats fine, but i cannot log in to any Users Notebook…

    So i tried the “Devcon.exe /rescan” than it scan, say’s scanning complete but nothig gets installed, nothing happens at all – any Ideas?

Leave a Reply

Comment moderation is enabled. Your comment may take some time to appear.