I have a batch file to process each Excel file found by FOR with a wildcard pattern with a Java application:
for %%i in ("../test data/sprint4/*.xls") do (
@echo "%%~fi"
)
I am running this batch file for example from
C:\dir1\dir2\dir3
and there is the file
C:\dir1\dir2\test data\sprint4\myfile.xlx
The output file name with full path is
C:\dir1\dir2\myfile.xls
test data\sprint4
is missing in the path and I am not sure what is wrong.
Someone suggested using /?
, but when I do echo /?
there is a very limited amount of information:
echo /?
Displays messages, or turns command-echoing on or off.ECHO [ON | OFF]
ECHO [message]Type ECHO without parameters to display the current echo setting.
This really does not explain usage of wildcards. Searches did not help either. So now I am stuck.
Why is full path of Excel files found in a directory specified with a relative path using wildcard pattern *.xls in above FOR loop wrong?