Making an .txt file with batch result in an Non-Print Char

May 24, 2014 at 01:10:42
Specs: Windows 7, AMD FX-6100 3.3GHz / 24 GB
Good morning all,
I am having some troubles with the following batch file.

[CODE]
@echo off
REM HERE WE ARE Making the List.txt that contains all the files that will be patched with the Patcher.
set LOCAL_RESCLIENT_DIR=e:\Pandoraflyff\Resclient
CD %LOCAL_RESCLIENT_DIR%
setlocal EnableDelayedExpansion
echo Ver:24 >%LOCAL_RESCLIENT_DIR%\list.txt
echo C:\\RESCLIENT>>%LOCAL_RESCLIENT_DIR%\list.txt
REM echo. >>%LOCAL_RESCLIENT_DIR%\list.txt
set "base=%CD%"
set "base=%base:*:=%\"

for /R %%a in (*.*) do (
for /F "tokens=1-5 delims=/-. " %%b in ("%%~Ta") do set "dateTime=%%d-%%c-%%b %%e%%f"
set size= %%~Za
set name= %%~PNXa
echo !dateTime! !size:~-10! !name:%base%=!>>!LOCAL_RESCLIENT_DIR!\list.txt
)
[/CODE]

Its creating an list.txt from files in their folders/subfolders
But for some reason if i call the list.txt with an c++ program its adding an DLE(Data Link Escape) Character. ASCII 016.

If i am using an c++ program for the list.txt creation i dont have any problems with it.
Could someone explain to me why this is happening


See More: Making an .txt file with batch result in an Non-Print Char

Report •


#1
May 24, 2014 at 03:32:24
!size:~-10! may be the culprit since it may lead to trash characters. What do you want to capture from "size"? It just contains the file size in bytes.

Report •

#2
May 24, 2014 at 03:59:27
Yes the actual Size should be !size:~-19! so it puts out this
The curl must be there otherwise it wont display the file name after the file size.

28735405 File.res

So the total text file is ending up in this format
2014-05-17 12:28 28735405 file.res
2014-05-24 09:26 907 test.bat

message edited by imagination


Report •

#3
May 24, 2014 at 04:17:59


Yes the actual Size should be !size:~-19! so it puts out this
... (?)

Sorry, I don't understand if you solved the trouble.


Report •

Related Solutions

#4
May 24, 2014 at 04:20:27
How do you not understand it?

I have changed the values an bit to see if that will solve it. But it wasnt the case.
The original was !size:~-19! and not -10.

Still it ads the DLE(Data Link Escape) Control Character.

SOLVED:
It was somewhere else in the batch file that causes the error.

message edited by imagination


Report •


Ask Question