I have this code, this always returns True and file get moved. What is the problem with my code ? I am running on Windows batch file.
@echo off
title echo
setlocal enableDelayedExpansion
for /F "tokens=* delims=" %%a in (vendor.txt) do (
CD /D H:\RCP\inbound\vendor\drop\%%a\
for /f "delims=" %%1 in ('dir *.xlsx /b') do (
set filename=%%~n1
set text=!filename!_Response_File.xlsx
set filepath=H:\RCP\outbound\vendor\%%a\!text!
echo !text!
echo !filepath!
echo H:\RCP\outbound\vendor\%%a\!text!
if exist H:\RCP\outbound\vendor\%%a\!text! (
echo file will be moved
) else (
echo file does not exist
)
)
)