China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 03:28
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Experts, come in! How to use DOS commands in cmd to remove a USB flash drive (the Safely Remove Hardware icon) View 3,156 Replies 7
Original Poster Posted 2008-05-29 22:40 ·  中国 福建 福州 连江县 联通
新手上路
Credits 4
Posts 1
Joined 2008-05-29 22:11
18-year member
UID 120037
Gender Male
Status Offline
Normally when we disconnect a USB flash drive, we have to right-click the lower right corner of the taskbar and remove hardware. Is there a way to do it with DOS commands instead?
Floor 2 Posted 2008-05-29 22:46 ·  中国 湖北 武汉 联通
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
It should be possible, search for rundll32.
Floor 3 Posted 2008-05-29 22:55 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Left-clicking is already very convenient...
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 4 Posted 2008-05-29 22:56 ·  中国 重庆 九龙坡区 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Floor 5 Posted 2008-05-29 23:01 ·  中国 重庆 电信
初级用户
★★
Credits 198
Posts 89
Joined 2007-09-06 23:22
18-year member
UID 96746
Gender Male
From 重庆
Status Offline
devcon ........ I looked it up online, seems like it has very powerful features.

[ Last edited by WANKOILZ on 2008-5-29 at 11:04 PM ]
Floor 6 Posted 2008-05-29 23:13 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline

@echo off
for /f %%i in ('devcon findall usb* ^|find /i "usb mass storage"') do devcon remove "@%%i"
devcon rescan


This deletes the installed USB drivers.
How can I make it only disable them?
Floor 7 Posted 2008-05-29 23:16 ·  中国 重庆 电信
初级用户
★★
Credits 198
Posts 89
Joined 2007-09-06 23:22
18-year member
UID 96746
Gender Male
From 重庆
Status Offline
Just try: devcon remove @usb\* . But first you need to download devcon.exe into system32
Floor 8 Posted 2008-05-30 16:47 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
The partition command built into XP can unmount it.
49206C6F766520796F752067757973 54656C3A3133383238343036373837
Forum Jump: