Jump to content

Help with batch needed


Recommended Posts

Posted (edited)

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:

Oh, yea, it seems to be OT but I need it for some removal work on the SOURCESS folder ;)

Edited by Oleg_II

Posted

Thanx! I found this one ;) but unfortunatelly it doesn't help - the codingpage of the new file is still UTF-16 LE :(

Posted

Well, it seems not to be possible :(

The only choice I have is to convert in other codepage with the command like this:

chcp 1251
type c:\file1.aaa > c:\file2.aaa

Posted (edited)

I know this is not a solution; however you can try this:

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

Result file should be in ANSI but like this:

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 )

Edited by lupo
Posted

lupo :hello:

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

Anyway, thanx! I've already have a working idea how to deal with languages ;)

  • 1 month later...
Posted (edited)

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).

Edited by Oleg_II
Posted (edited)

You could try this but I have no experience with it.

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.

Edited by Tomcat76
Posted (edited)

Tomcat76 :hello:

That's already something, thanks!

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.

Edited by Oleg_II
Posted

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.

Posted (edited)

Thanks TommyP :thumbup

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) ;)

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.

Edited by Oleg_II

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...