storing command output in a variable
Posted: 23 Nov 2008 01:28
I will be receiving a file from a different system and will process it. However the filename is dynamic.
INFILE_IETPAT_V_NNNNNN_NNN.CSV ( Where N is a numeric value )
I need the actual filename for processing it. Please note at a time only one file will be present inside VDMT folder.
I have written following piece of code-
set filename=%dir/b C:\VDMT\INFILE_IETPAT_V*%
however the output of dir command is not being stored rather the whole %dir/b .....% string is being stored.
Can anyone please throw some light?
INFILE_IETPAT_V_NNNNNN_NNN.CSV ( Where N is a numeric value )
I need the actual filename for processing it. Please note at a time only one file will be present inside VDMT folder.
I have written following piece of code-
set filename=%dir/b C:\VDMT\INFILE_IETPAT_V*%
however the output of dir command is not being stored rather the whole %dir/b .....% string is being stored.
Can anyone please throw some light?