Jump to content

Scan New hardware Chanhed ?


qube
 Share

Recommended Posts

use devcon... http://support.microsoft.com/?kbid=311272

devcon rescan

I wrote the same functionality with wmi ... slow and deleted ... so go to above link.

Lar.

As far as i know Larry you also wrote this:

Local Const $CM_LOCATE_DEVNODE_NORMAL = 0
        Local Const $CR_SUCCESS = 0
        $status = DllCall("cfgmgr32.dll", "int", "CM_Locate_DevNode", "int*", 0, "int", 0, "int", $CM_LOCATE_DEVNODE_NORMAL)
        If Not ($status[0] = $CR_SUCCESS) Then
            MsgBox(4096, "", "CM_Locate_DevNode failed: " & $status[0])
            Return 0
        EndIf
        $status = DllCall("cfgmgr32.dll", "int", "CM_Reenumerate_DevNode", "int", $status[1], "int", 0)
        If Not ($status[0] = $CR_SUCCESS) Then
            MsgBox(4096, "", "CM_Reenumerate_DevNode failed: " & $status[0])
            Return 0
        EndIf

And it's not slow :) Works like a charm :P

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

code is very well but it not work with my program.

my program is "use to disable and enable usbstorage"

normally my pc is disable substorage

with this code

RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","start","reg_dword","3")

while i need to use usbtorage

i just run this code

RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","start","reg_dword","4")

then i must replug the flash drive after that the computer found my flash drive.

the problem is what way i re scan flash drive but not replug my flash drive.

i tried code that you gave me but it didn't work.

Call me "Queen of Pain" :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...