このスクリプトはhttp://network-blog.lan-secure.com/2008/03/usb-detection-using-wmi-script.htmlで見つけました
strComputer = "." '(Any computer name or address)
Set wmi = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set wmiEvent = wmi.ExecNotificationQuery("select * from __InstanceOperationEvent within 1 where TargetInstance ISA 'Win32_PnPEntity' and TargetInstance.Description='USB Mass Storage Device'")
While True
Set usb = wmiEvent.NextEvent()
Select Case usb.Path_.Class
Case "__InstanceCreationEvent" WScript.Echo("USB device found")
Case "__InstanceDeletionEvent" WScript.Echo("USB device removed")
Case "__InstanceModificationEvent" WScript.Echo("USB device modified")
End Select
Wend
このスクリプトは、必要なものの隣にあります。USB ドライブの挿入を検出します。USBドライブのドライブ文字を見つけるためにそれを変更する方法は? ドライブ文字を取得すると、挿入時に「USB デバイスが見つかりました」と表示される代わりに、アバスト アンチウイルスのコマンド ライン スキャナーを実行して、挿入時にドライブを自動的にスキャンできます。ガイドしてください!