Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have tried using echo. (echo followed by period) to create a blank
line. I get the error:
'echo.' is not recognized as an internal or external command,
operable program or batch file.
Any ideas/suggestions would be helpful.
Thanks in advance.
Here is the bat file:
@echo off
REM HNACP00012012
if "%1"=="" goto usage
if "%2"=="" goto usage
if "%3"=="" goto usage
for /f "skip=1 delims=" %%a in ('DIR "%~1\%~2*.%3" /A-D /O-D /B /TW')
do ECHO %1\%%a
for /f "skip=1 delims=" %%a in ('DIR "%~1\%~2*.%3" /A-D /O-D /B /TW')
do del "%1\%%a"
goto xit
:usage
echo Usage: %0 directory fileprefix fileextension
echo.
echo This will change to the specified directory.
echo It will delete all files named fileprefix*.fileextension except
the one last written to.
echo.
echo Example: %0 c:\INFOSTAT\temp HISRpt txt
echo.
echo This will delete all files named HISRpt*.txt in the
c:\INFOSTAT\temp directory
echo except the one with the latest write date.
:xit
Here is what I get when I issue the command: CleanAllButLast
Usage: CleanAllButLast.bat directory fileprefix fileextension
'echo.' is not recognized as an internal or external command,
operable program or batch file.
This will change to the specified directory.
It will delete all files named fileprefix*.fileextension except the one
last wri
tten to.
'echo.' is not recognized as an internal or external command,
operable program or batch file.
Example: CleanAllButLast.bat c:\INFOSTAT\temp HISRpt txt
'echo.' is not recognized as an internal or external command,
operable program or batch file.
This will delete all files named HISRpt*.txt in the c:\INFOSTAT\temp
directory
except the one with the latest write date.

Do you ger the error message under Windows NT, XP or both systems?
You posted NT and XP as your running environments and sometime NT is rich of astounding behaviors.

Anyway the following acts exactly as Echo. does
Ver | Find /V "er"
and may be used to work around the trouble.

Thanks for the replies. I actually tested the file on XP.
I had also posted my issue to the alt.msdos.batch group (should have been to alt.msdos.batch.nt group). In the alt.msdos.batch.nt group I found that the problem was I had a file named "echo" (don't know why) in the same directory as my bat file. Removing that file caused the echo. (echo followed by period) to work correctly.
Additionally, I found if I used echo, (echo followed by comma) that I got a blank line even if I had the "echo" file present in the same directory.

i dont know c++ but cant you just use \n on the end of the previous line?
example:
echo Usage: %0 directory fileprefix fileextension\n
instead of
echo Usage: %0 directory fileprefix fileextension
echo.sorry if it doesnt help you but it just seems familiar.
FBI Agent
AIM: EliteAssassin187

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |