Thursday, October 06, 2005 9:35 AM
Hi at first THX for your elp with the New Lines. I created a Batch File like this:
My.Computer.FileSystem.WriteAllText("C:\modelcompiler.bat", " cd sourcesdk" & vbNewLine & "bin\studiomdl ..\sourcesdk_content\sourcesdk_content\hl2\modelsrc\" & file, False)
The text works, but when I try to run this File a weird text comes up in the console:
"Der Befehl ist entweder falsch geschrieben oder konnte nicht gefunden werden" Is german and means that this command couldn't be found, but when I type it without a Batchfile in the Console it works. I hope That you can help me.
Thursday, October 06, 2005 2:34 PMThe "weird text" is probably the UTF.8 byte order mark. Since you don't specify a fourth argument in the WriteAllText call, UTF-8 encoding will be used. You can try using another encoding (from System.Text.Encoding) that doesn't write a BOM, such as Encoding.Default.
Thursday, October 06, 2005 4:01 PMSo THX for your answear. But I don' really understand. What is the right Text encoding?
How would it work I have no idea what I should do.
Sorry but I'm new to VB2005 (sometimes it's really "weird" and there are promlems which I didn't expect). I think I have to to become acquainted with VB2005. I workes with for VB6 2 years. OK I don't want to anoy.
Thursday, October 06, 2005 6:58 PMModeratorHi,
You can use this:
My.Computer.FileSystem.WriteAllText("C:\modelcompiler.bat", " cd sourcesdk" & vbNewLine & "bin\studiomdl ..\sourcesdk_content\sourcesdk_content\hl2\modelsrc\" & file, False, System.Text.Encoding.ASCII)
The right text encoding can be ASCII, which does not have the Byte Order Mark. For more information about what encoding is, you can start with http://msdn2.microsoft.com/en-us/library/86hf4sb8.
Friday, October 07, 2005 12:37 PMOk the encoding works, but there are still some probs...