1.

Solve : DIR /b output to Variable??

Answer»

I've been struggling on this for a few DAYS and I finally found this WEBSITE... Maybe someone can help me.

Here's what I want to do:
From a CD(s) take the only file on it, (a .DAT file) and store that filename in a Variable... (btw, these are backup db cds, with time dated FILENAMES)

Sounds easy, but I'm completely lost.
I was trying to use DIR /B... But then I can't figure out how to store that in a variable.

I want to do something like:
SET FILENAME=('DIR /B G:/')

or SET FILENAME= < DIR /B G:/ (first file?)??If there is only 1 file then you don't need a loop.

I am giving that thing;
for /F %a in ('dir /b') do set variable=%a



Discussion

No Comment Found