I need a .bat and .sh script to list the all the *.xml files from source folder into one csv/txt file and copy csv/txt file into destination folder.
@ECHO OFF
NET USE X: /DELETE
NET USE X: \\SERVER\TEST
setlocal ENABLEDELAYEDEXPANSION
echo. > X:\XML_Response\xml_file_list.csv
set searchid="%<OrderNumber>"
for /f %%a in ('findstr /i /m %searchid% X:\XML_Response\*.xml') do (
echo %%a >> X:\XML_Response\xml_file_list.csv
)
NET USE X: /DELETE
Above code give me list of files with path. I just want to have filenames.
X:\XML_Response\SO2001.xml
X:\XML_Response\SO2002.xml
I need only
SO2001.xml
SO2002.xml
Can anyone help