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-24 14:53
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » fsutil fsinfo drives View 2,794 Replies 18
Floor 16 Posted 2007-01-14 07:56 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

@echo off
if "%~s1"=="" goto end
for /f "skip=1 delims= " %%a in ('Wmic LogicalDisk Get Caption') do (
call set drive=%%drive%% %%a
)
echo %drive%
set/p=&exit/b 0

:end
Setlocal EnableDelayedExpansion
for /f "skip=1 delims= " %%a in ('Wmic LogicalDisk Get Caption') do (
set a=%%a
set drive=!drive! !a!
)
echo %drive%&EndLocal
set/p=&exit/b 0
Floor 17 Posted 2007-01-14 11:42 ·  中国 广东 广州 白云区 电信
中级用户
★★
Credits 251
Posts 108
Joined 2007-01-07 11:33
19-year member
UID 75721
Gender Male
From 湖南==>广州
Status Offline
Floor 18 Posted 2007-10-21 11:31 ·  中国 浙江 温州 电信
初级用户
★★
Credits 158
Posts 89
Joined 2007-04-25 08:06
19-year member
UID 86402
Gender Male
Status Offline
Floor 19 Posted 2009-05-22 08:45 ·  中国 安徽 合肥 电信
初级用户
Credits 68
Posts 45
Joined 2008-11-23 17:53
17-year member
UID 131856
Gender Male
Status Offline
I can't understand it very well. I ran the code on floor 15 and 16, and it seems to display the current disk. If that's the case, I'll also post a simple command:

fsutil fsinfo drives
Forum Jump: