The simplest solution is to specify the drive and path in the WHERE clause, and let WMIC discover the file names. You can also specify VERSION IS NOT NULL in the where clause.
The listed FileName will be the base file name only, without the extension. The extension is available in the Extension column (fancy that!).
wmic datafile where "drive='c:' and path='\\Program Files (x86)\\Oracle\\Document Capture\\' and version is not null" get FileName, Extension, Version
Columns are always listed in alphabetical order (by name), regardless what order you requested. So you should get output like the following:
Extension FileName Version
dll vabc 1.3
dll vabd 1.3
dll vace 1.3
Or you can request the Name column instead of FileName and Extension, but that will include the complete path.
Name Version
C:\Program Files (x86)\Oracle\Document Capture\vabc.dll 1.3
C:\Program Files (x86)\Oracle\Document Capture\vabd.dll 1.3
C:\Program Files (x86)\Oracle\Document Capture\vace.dll 1.4
The other option is to use a FOR loop to iterate all the files, and then pass the full path of each file in a separate WMIC call that is parsed by a FOR /F. There is an unfortunate "feature" (aka bug) with how FOR /F converts WMIC unicode output into ansi, such that all lines have an unwanted trailing carriage return (\r) that can lead to various problems. The unwanted trailing \r is eliminated by an extra FOR /F statement.
The VERSION IS NOT NULL clause is not needed because the pair of FOR /F statements will strip out lines that contain nothing but spaces.
@echo off
set "loc=C:\Program Files (x86)\Oracle\Document Capture\"
pushd "%loc%"
for %%F in (*) do for /f "skip=1 tokens=*" %%A in (
'wmic datafile where "name='%loc:\=\\%%%F'" get version 2^>nul'
) do for /f "delims=" %%V in ("%%A") do echo %%F %%V
popd
Output should then look like the following:
vabc.dll 1.3
vabd.dll 1.3
vace.dll 1.4