driveid = mid(strdrive, i, 3) '枚举盘符
if driveid = chr$(0) & chr(0) & chr(0) then exit for '没有盘符,即时退出循环
if getdrivetype(driveid) = 5 then call shellpro(driveid)
'如果枚举到的盘是cd-rom,转到 shellpro 子程序
next i
end sub
'子程序:::::打开文件
sub shellpro(drivepro as string)
on error goto err_file:
if not isemptycdrom(drivepro) then
shell (drivepro & "hello.exe") '打开文件路径
unload me