I am trying to create a sources txt file to pass to the javac compiler. In the text file, I need to have the paths of all the .java files in the subdirectories surrounded by speech marks, in case the folder names contain spaces, and any \ for the path need to be \\ because \ is escaped. With the text file I would run `javac -d \classes @sources.txt` . This works and I have tested it with paths I have written into sources.txt. However, I have been experimenting with trying to get the command line to create this file for me as it would be a hassle if there were more files and I had to write every single path.

So far I have tried running `for /f "delims=" %A in ('dir /s /B *.java') do @echo "%A" >>sources.txt`. The dir command gets all the paths and the echo surrounds the commands with speech marks but when I try running the following command instead to switch the \ to \\ it doesn't work:

```
for /f "delims=" %A in ('dir /s /B *.java') do @echo "%A:\=\\" >>sources.txt

```

This returns the "<thepath>:\=\\". What am I doing wrong?
FYI: this is directly in the cmd line and not ran from a file.
Thanks.