I’m try to make batch file that looks in the dir that it is running in looking for .xml. then take the file name of the XML and sets it as a variable for use finding the file that changes need to made to and to be used in the file its self.
I’m use Change.com to change text in the XML file.
But the way that I’m getting the file name dose not work if there is special chracters in the filename like a space.
Here is a working version of what I have:
@echo off
for /F %%a in (‘dir /b *.xml’) do set FileName=%%~na
echo what file do you have %Filename%
echo.
pause
echo lets make a file….
change.com %Filename%.xml “***FILE_NAME***” “%Filename%”
echo.
pause
===============================
@echo off & setLocal EnableDELAYedeXpansion
for /f “tokens=* delims= ” %%a in (‘dir/b *.xml’) do (
move /y “%%a” #
change # “bla” “nobla”
move /y # “%%a”
)
=====================================
Life is too important to be taken seriously.
M2