Bhx 3.1

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
npocmaka_
Posts: 516
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: Bhx 3.1 [latest version]

#31 Post by npocmaka_ » 30 Jan 2014 18:13

After a little bit debugging - the problem was in the `CreateObject(#Scripting.FileSystemObject#)OpenTextFile(..).Write(..binary...)`


The issue appears when my language settings are set to bulgarian. If I set them to US there's no problem.I don't know the reason and if it can be fixed in the script ,but at least I have a clue :)

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: Bhx 3.1 [latest version]

#32 Post by carlos » 30 Jan 2014 18:39

@npocmaka_: Thanks for the test. I suspect that is because the pathfilename argument in opentextfile, maybe it have some poison characters.
Please, you can send me this path ?

I will fix this in the next update of bhx when also I added the option of créate the binary using only batch.

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: Bhx 3.1 [latest version]

#33 Post by carlos » 20 Feb 2014 02:59

@npocmaka: I reproducing the problem in windows xp using the bulgarian language, and I found the problem. But I cannot solve, seems to be a bug from microsoft.
The problem is in the write function.
Last edited by carlos on 20 Feb 2014 07:23, edited 1 time in total.

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: Bhx 3.1 [latest version]

#34 Post by carlos » 20 Feb 2014 07:16

i found a solution (use other fw object):

the new stuff for implement in the new version (commented and in red the removed code that cause the bug) and in blue the new lines:

set o=createobject("scripting.filesystemobject")
set fr=o.opentextfile("image.gif.hs",1,0,0)
'set fw=o.opentextfile("image.gif",2,1,0)
set fw=createobject("adodb.stream")
fw.charset="windows-1252"
fw.type=2
fw.open

do until fr.atendofstream
d=fr.readline
for i=1 to len(d) step 2
'fw.write chr(cbyte("&h" &mid(d,i,2)))
fw.writetext chr(cbyte("&h" &mid(d,i,2)))
next
loop
fw.savetofile "image.gif",2
fw.close
fr.close
set fw=nothing
set fr=nothing
set o=nothing


i would post a new version of bhx coming soon that will implement this fix for the bulgarian windows.

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: Bhx 3.1 [latest version]

#35 Post by carlos » 20 Feb 2014 18:11

I have ready the new version of bhx.
I will post coming son in a new site, because google code not allow new uploads.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Bhx 3.1 [latest version]

#36 Post by Squashman » 20 Feb 2014 18:19

carlos wrote:I have ready the new version of bhx.
I will post coming son in a new site, because google code not allow new uploads.

Maybe you could use CodePlex or Sourgeforge.

Post Reply