Hamcher Posted February 19 Share Posted February 19 Hey all, this is my first time posting and I have had a little look around to see if I could find my issue before posting. I am writing a script to detect when a drive (specific drive letter) is mounted, then run a file on that drive. Currently I am using the USB mounting detection but that doesn't detect when a CF card is inserted into my reader, it only detects when I unplug the reader (with the card in it) then plug it back in. Below is my current code: $DBT_DEVICEARRIVAL = "0x00008000" $WM_DEVICECHANGE = 0x0219 GUICreate("") GUIRegisterMsg($WM_DEVICECHANGE , "MyFunc") Func MyFunc($hWndGUI, $MsgID, $WParam, $LParam) If $WParam == $DBT_DEVICEARRIVAL Then Run ("E:\run_emu.bat") EndIf EndFunc While 1 $GuiMsg = GUIGetMsg() WEnd Any help would be greatly appreciated, Cheers, Hamcher. Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now