I used "Win+R" to bring up the console.
After entering the command: for /f %i in ('devcon findall usb* ^|find /i "usb mass storage"') do devcon remove "@%i", the console window closed directly.
When I replaced the command with: for /f %i in ('devcon findall usb* ^|find /i "usb mass storage"') do echo hello, the console still closed automatically.
I directly ran devcon findall usb*, which worked normally.
Running devcon findall usb* | find /i "usb mass storage" worked normally.
I don't know where the problem lies.