原帖由 flyzr 于 2009-6-4 23:43 发表
@echo off
setlocal enabledelayedexpansion
echo 該電腦的CD-ROM盤符有:
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
for /f "delims=" %%j in ('fsutil fsinfo drivetype %%i:^|fi ...
原帖由 dominater 于 2009-10-14 18:37 发表
@echo off
set str=a b c d e f g h i j k l m n o p q r s t u v w x y z
echo 当前存在的盘符:
for %%i in (%str%) do (
if exist %%i:
echo %%i
这是JM大大FOR教程里的压箱底之作~
@echo off
@echo. >>tmp.txt
call disk.vbs
for /f "tokens=*" %%i (tmp.txt) do echo %%i
del tmp.txt
pause
-----------------------------------------disk.vbs-------------------
dim fso,dc,tf
set fso=createobject("scripting.filesystemobject")
set dc=fso.drives
for each d in dc
if d.drivetype="4" then
n=n & d.driveletter & ":" & "CD-ROM" & vbcrlf
end if
next
set tf=fso.createtextfile("tmp.txt",true)
tf.write n
tf.close
vbs了解太少,各位请多指教!!