![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-26 04:54 |
47,813 topics / 349,918 posts / today 0 new / 48,275 members |
| DOS批处理 & 脚本技术(批处理室) » [Closed]Is there a batch script to delete a USB drive |
| Printable Version 15,047 / 66 |
| Floor31 ayincn | Posted 2007-06-28 15:07 |
| 新手上路 Posts 1 Credits 2 | |
| Floor32 xshrimp | Posted 2007-07-02 13:51 |
| 新手上路 Posts 5 Credits 10 | |
| Floor33 leton | Posted 2007-07-02 15:06 |
| 初级用户 Posts 72 Credits 170 | |
|
Hey, can you modify it to achieve real-time monitoring of USB storage devices and automatically delete them once detected?
|
|
| Floor34 leton | Posted 2007-07-02 15:07 |
| 初级用户 Posts 72 Credits 170 | |
|
Add a delay, but it feels that it will cause the system performance to decline
|
|
| Floor35 jsb2008 | Posted 2007-08-21 13:39 |
| 初级用户 Posts 22 Credits 43 | |
|
Extremely powerful! Thanks to the LZ for sharing!!!
|
|
| Floor36 zyfcxp | Posted 2007-09-07 17:42 |
| 初级用户 Posts 24 Credits 41 | |
|
Thanks for sharing
|
|
| Floor37 densefog | Posted 2007-09-14 18:31 |
| 新手上路 Posts 1 Credits 2 | |
|
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. |
|
| Floor38 ice360 | Posted 2007-10-27 23:08 |
| 初级用户 Posts 10 Credits 20 | |
|
Let's give it a try. I don't know if it will work well.
|
|
| Floor39 zysheng110 | Posted 2007-10-29 01:00 |
| 初级用户 Posts 16 Credits 31 | |
|
Learning! There are many things I don't know, and now I'm dizzy.
|
|
| Floor40 mayu2004 | Posted 2007-12-22 16:16 |
| 初级用户 Posts 40 Credits 109 | |
| Floor41 tyndall | Posted 2008-01-14 12:41 |
| 新手上路 Posts 3 Credits 8 | |
|
I used it, but it was recognized immediately after deletion. After removing the devcon rescan test, I found that my USB mouse was also uninstalled, and I had to use devcon rescan to load it again.按理说 the line find /i "usb mass storage" is already limited to only uninstalling USB storage devices... Why doesn't mine work? Running the command devcon findall usb* alone and running the command devcon findall usb* |find /i "usb mass storage" gives the same result
|
|
| Floor42 fengwei1980 | Posted 2008-02-27 10:33 |
| 新手上路 Posts 5 Credits 6 | |
|
A very good tool wants to be downloaded. Please give some points, hehe
|
|
| Floor43 lac312 | Posted 2008-03-29 23:44 |
| 新手上路 Posts 8 Credits 16 | |
|
Hehe ~ very classic~ My suggestion is to add a delay in the middle, so that there is enough time to unplug the USB~ For example, ping 127.1 -n 20 >nul
Just my humble opinion~ |
|
| Floor44 lac312 | Posted 2008-03-29 23:47 |
| 新手上路 Posts 8 Credits 16 | |
|
@echo off
for /f %%i in ('devcon findall usb* ^|find /i "usb mass storage"') do devcon remove "@%%i" ping 127.1 -n 20 >nul devcon rescan pause echo Hehe, test successful, very good, very powerful~ |
|
| Floor45 linquanhouzi | Posted 2008-03-30 12:13 |
| 新手上路 Posts 1 Credits 2 | |
|
Classic! I like it
|
|
| Prev 1 2 3 4 5 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |