Question about NUL char.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
darioit
Posts: 230
Joined: 02 Aug 2010 05:25

Question about NUL char.

#1 Post by darioit » 05 Sep 2011 03:14

Hello,

someone could explain because Hex 00 make EOF on txt file, and cause termination of routine like this?
FOR /F "tokens=* skip=10" %%i IN (%2) DO echo %%i

The line after Nul char are not view

Regards
Dario

jeb
Expert
Posts: 1055
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: Question about NUL char.

#2 Post by jeb » 05 Sep 2011 03:48

Hi darioit,

I suppose the reasons could be that the internal termination character
in the memory is the NUL character for all variables.

Once Joey has examine this, that the variables are stored like
var1=abcdefr\0var2=hgftr\0path=C:\windows\0

EDIT: But you can retest it with the set/p technic, this can read after a NUL character
Only the characters after the null in the current line are removed,
they seem to be unreachable

jeb

Post Reply