Getting connected Flashdrive list - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Getting connected Flashdrive list

dwmorenojrdwmorenojr Posts: 1Member
I am trying to get a list of connected Flash drives that appear horizonally
like this:
Connected Drives: [color=Blue]H: I: J: K: L:[/color]

My Problem is when I perform the variable substitution I get a nul. I have researched for 3 weeks now, and have come to the conclusion that it may not be possible. Can anyone get this code to work???

REM --------------SETUP-------------------
rem ---> setup vbs file <---
echo > "vbs.vbs" Set objSWbemServices = GetObject("winmgmts:\.")
echo >>"vbs.vbs" Set colSWbemObjectSet = objSWbemServices.InstancesOf("Win32_LogicalDisk")
echo >>"vbs.vbs" For Each objSWbemObject In colSWbemObjectSet
echo >>"vbs.vbs" If UCase(objSWbemObject.Description) = "REMOVABLE DISK" Then WScript.Echo objSWbemObject.DeviceID
echo >>"vbs.vbs" next

rem --------get drive list----------------
set LIST=
for /F %%a in ('cscript //nologo "vbs.vbs"') do (
echo %LIST
Sign In or Register to comment.