I have this batch script that initiates a an empty quote variable and then it loops a target directory and appends the paths of the batch files to the variable to then output to a file.
I have been debugging the script and it says
do(call was unexpected at this time
The script is here:
set a=
for /R C:\Target\Directory %%i in (*.bat) do( call set a="%a%;%%i")
echo %a% > output.txt
How can I modify the script to print the directories of the bat files within the target directory using only a batch file not PowerShell.
" " " " " " " ";C:\Target\Directory\mockup\file1.bat";C:Target\Directory\mockup2\mockup\file2.bat"
Does that have to do with the way a was initialized I believed it would come out more as such?
"C:\Target\Directory\mockup\file1.bat";"C:Target\Directory\mockup2\mockup\file2.bat"
I would not bother with the environment variable, just create a blank file and append to it.
echo "" > c:\temp\output.txt
for /R C:\ %i in (*.bat) do echo %i >> c:\temp\output.txt