I want to run an autoit program on my computer automatically when a USB is plugged in, how can I do it?
Or you may want to try this one :
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
; Description of DEV_BROADCAST_VOLUME : https://learn.microsoft.com/en-us/windows/win32/api/dbt/ns-dbt-dev_broadcast_volume
HotKeySet("{ESC}", Terminate)
Global Const $DBT_DEVICEARRIVAL = 0x8000
Global Const $DBT_DEVTYP_VOLUME = 2
Global Const $tagDEV_BROADCAST_VOLUME = "DWORD dbch_size;DWORD dbch_devicetype;DWORD dbch_reserved;DWORD dbcv_un