Sign in to follow this  
Followers 0
qube

Scan New hardware Chanhed ?

6 posts in this topic

Can I Scan New hardware Chanhed ?

by using Autoit script

thank


Call me "Queen of Pain" :)

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

thanks grasshopper...

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

Thank dude


Call me "Queen of Pain" :)

Share this post


Link to post
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" :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0