Help - Search - Members - Calendar
Full Version: Help with batch needed
MSFN Forums > Member Contributed Projects > HFSLIP

   
Google Internet Forums Unattended CD/DVD Guide
Oleg_II
Anybody knows how to convert a text file with UTF-16 LE codepage to 65001 (UTF-8) codepage with a batch command?

It can be done with a text editors but I need to do it with CMD or BAT file wacko.gif

Oh, yea, it seems to be OT but I need it for some removal work on the SOURCESS folder newwink.gif
tommyp
try this:
copy SOURCESS\I386\FILENAME1.111/A SOURCESS\I386\FILENAME2.111/B
Oleg_II
Thanx! I found this one newwink.gif but unfortunatelly it doesn't help - the codingpage of the new file is still UTF-16 LE sad.gif
Oleg_II
Well, it seems not to be possible sad.gif

The only choice I have is to convert in other codepage with the command like this:
CODE
chcp 1251
type c:\file1.aaa > c:\file2.aaa
lupo
I know this is not a solution; however you can try this:

CODE
echo >empty.txt
fc /LB700000 yourfile.txt empty.txt >newfile.txt


Result file should be in ANSI but like this:

CODE
T
h
i
s

i
s

m
y

n
e
w

f
i
l
e
etc..



You can try /u (unicode) option in fc command (this will use a different codepage; simply specify it with chcp )
Oleg_II
lupo welcome.gif

Thank you very much! Unfortunately it didn't work on INTL.INF - if modified it like this it doesn't install additional languages sad.gif

Anyway, thanx! I've already have a working idea how to deal with languages newwink.gif
Oleg_II
Anybody knows the script for taking INF files from say HFDRV folder and placing them renamed and CABed in SOURCESS\I386 folder?

For example, if there are 3 INF files in HFDRV - 815.inf, ich3ide.inf, cdma.inf, they will be renamed and CABed into SOURCESS\I386 folder as hfdrv1.in_, hfdrv2.in_ and hfdrv3.inf.

There are other files like SYS, BIN, EXE in HFDRV folder too.

The names for the INF files may be random (different in each time).
Tomcat76
You could try this but I have no experience with it.

CODE
for %%i in (HFDRV\*.inf) do makecab /D CompressionType=LZX /D CompressionMemory=21 %%i
copy HFDRV\*.in_ SOURCESS\I386
del /q HFDRV\*.in_


Edit...
Ah, I see you want to rename them to hfdrv1, etc. I wouldn't know how to do that.
Oleg_II
Tomcat76 welcome.gif
That's already something, thanks!
CODE
for %%i in (HFDRV\*.inf) do makecab /D CompressionType=LZX /D CompressionMemory=21 /L SOURCESS\I386 %%i


Two more parts needed:

1. Renaming INF files according to the scheme - hfdrv1.inf, hfdrv2.inf, etc.

2. Inserting HFDRV*.INF to DOSNET.INF, LAYOUT.INF and TXTSETUP.INF.
tommyp
CODE
ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
set /A OLEG=1
ECHO [SourceDisksFiles]>>SOURCESS\I386\TXTSETUP.SIF
ECHO [Files]>>SOURCESS\I386\DOSNET.INF
FOR /F "USEBACKQ DELIMS==" %%I in (`DIR /A-D /OGN /B HFDRV\*.INF`) do (
copy HFDRV\%%I HFDRV\HFDRV!OLEG!.inf
MAKECAB /D CompressionMemory=21 /D CompressionType=LZX HFDRV\HFDRV!OLEG!.INF /L SOURCESS\I386
DEL /Q /F HFDRV\HFDRV!OLEG!.inf
set /A OLEG=!OLEG!+1
ECHO HFDRV!OLEG!.inf=1,,,,,,,20,0,0 >>SOURCESS\I386\TXTSETUP.SIF
ECHO d1,HFDRV!OLEG!.inf>>SOURCESS\I386\DOSNET.INF
)


You need the echo sourcedisksfiles section if you are running this on an hfslipped source.
Oleg_II
Thanks TommyP thumbup.gif
Do you think it is worth including in HFSLIP? It's drivers integration part. I though that renaming INF files will be safe for reducing source and you can include this in any part of the script (before or after reducing) newwink.gif

PS I forgot, with CABing HFDRV folder source in one HFDRV.CAB and including its entries into DOSNET.INF, LAYOUT.INF and TXTSETUP.SIF too (I suggested the code here.
tommyp
Sure, I can take care of it after Christmas.
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.