I'm tearing my hair out now.
I have a batch file that searches through sub directories looking for jpg files and then parses some simple HTML code using the file names it finds and pushes this to a text file.
It is vitally important that each line of every file created is separated by a blank line.
This is why I have included the "Echo." lines. See batch file code below:
pushd \\SRVAPP1\Image Archive
Echo %CD%
PAUSE
for /R %CD% %%F in (*.jpg) do (
Echo %%~nF
Echo.
Echo ^<html^>^<img src='^.%%~pnxF' ^>^<a href='^.%%~pnxF'^>Download file^<^/a^>^<^/html^>
Echo.
Echo ^[^[Open file^|file^:^.%%~pnxF^]^]
Echo.
Echo ^[^[Show in folder^|file^:^.%%~pF^]^]
) > ".\Documentation\%%~nF.tid"
popd
PAUSE
The loop iterates through the first sub directory fine and creates a perfect output. example below
YORYM_TA1
<html><img src='.\2014-03-13\JPG\YORYM_TA1.jpg' ><a href='.\2014-03-13\JPG\YORYM_TA1.jpg'>Download file</a></html>
[[Open file|file:.\2014-03-13\JPG\YORYM_TA1.jpg]]
[[Show in folder|file:.\2014-03-13\JPG\]]
However, when the batch file moves onto the second directory - and all subsequent directories "Echo." seems to be replaced by "Echo.." and you get the following output (complete with full stops instead of blank lines):
YORYM_H2200_8
.
<html><img src='.\2014-05-22\JPG\YORYM_H2200_8.jpg' ><a href='.\2014-05-22\JPG\YORYM_H2200_8.jpg'>Download file</a></html>
.
[[Open file|file:.\2014-05-22\JPG\YORYM_H2200_8.jpg]]
.
[[Show in folder|file:.\2014-05-22\JPG\]]
Any ideas why this may be occurring? I am running windows 7.