Home PcOnHand

OnHand Pc Details








Since The OnHand Pc is more or less compatible with the Ruputer (Japanese Watch), many of the programs written for the old Ruputer watch will also work for the OnHand Pc.  Many of these programs have an LZH extension which means that they are compressed.  Winzip is unable to uncompress these files, but LHA, an older freeware program, does the job.

Download LHA Version 2.13 NOW!

How to uncompress files?  
In Dos type: LHA x <filename.lzh>

More Information

LHA <command> [/<option> ARC [[DIR\] [FILE]...]... [-+012|WDIR]...]

<command>: if none are specified, you get the help screen or a list of FILE(s).
<option>: you may supply one or more of options explained below. (needs an / or - in front, to designate an option)

ARC: archive name.
DIR: base directory name.
FILE: File name or full pathname if specified.
WDIR: Working Directory name.


a (Add) compress and add to an archive.

Compress and Add files specified to an archive. If the named archive does not exist, then create one with the name. LHA overwrites any file in the archive by the given file name with 'a' command. Compare with 'u' command.  The commands 'a' and 'm' are used to make an archive.

< Example 1 > LHA a EX *.EXE

LHA makes an archive named EX.LZH from all the files with extension 'EXE'. Extension .LZH is default.

u (Update) Compress and Update.

Compress and add files specified to an archive as command 'a'.  If LHA detects a file with the name same as the one in the archive, then LHA selects the new one to add to archive, by comparing the time stamp of each.

< Example 2 > LHA u EX *.C

All the FILE(s) with extension '.C' are archived in EX.LZH.  If you already have an SX.LZH containing a FILE with the same name, only the one with newer time stamp is archived.

m (Move)

Compress and add to an archive as 'u' command with checking time stamps. The difference is that LHA deletes all the files moved into the archive.

< Example 3 > LHA m EX *.C

does the same as

LHA u EX *.C
del *.C

Watch the second line. With the /C option, LHA removes all the FILE(s) into the ARChive ignoring time stamps. You may lose the one with the older time stamp.

f (Freshen)

LHA looks for a FILE with the same name as the FILE in the archive. If it finds one with a newer time stamp, LHA rewrites the one in the archive. 'LHA f /c ARC ' will not check the time stamp.

< Example 4 > LHA f EX LHA.DOC

You have LHA.DOC compressed and archived in EX.LZH. You get a new LHA.DOC, then you replace the one in the ARChive, also.

d (Delete)

LHA deletes a file (or files) in the archive.

< Example 5 > LHA d ex lha.doc

LHA deletes lha.doc in the ARChive ex.LZH.

e (Extract)

LHA extracts FILE(s) from the archive with decompressing. If LHA finds a FILE in the archive with a newer FILE on the same DIR and having the same name, it skips that FILE(s). LHA extracts FILE(s) from ARChives made by L113C, namely, those with the compression ids -lzs-, -lz4-, -lz5-.

<Example 6 > LHA e EX 

Extracts all the FILE(s) in the archive 'EX.LZH'.

< Example 7 > LHA e EX *.COM

LHA extracts all the files with extension .COM from 'EX.LZH'.

x (eXtract) LHA eXtracts compressed FILE with pathnames.

If LHA can not find any path, then it will create directories.  FILE(s) must be archived with full-pathnames. LHA restores the entire directory structure. 'LHA e /x1m1 ARC' does the same.

< Example 8 > LHA x EX

Suppose '\BIN\CG86.EXE' were among the FILE(s) in 'EX.LZH'. LHA creates directory '\BIN' if necessary, and extracts 'CG86.EXE' there.

p (Print) Print FILE on standard out.

LHA prints FILE decompressing from ARC to standard output.

< Example 9 > LHA p ex lha.doc

LHA extracts 'LHA.DOC' from 'EX.LZH' and displays it on your terminal.

< Example 10 > LHA p EX LHA.DOC > prn

LHA extracts 'LHA.DOC' from 'EX.LZH' and prints it out from your printer.

l (List)

LHA lists FILE names in the archive on a line. A FILE with pathname will have a mark '+' on the head of the line. 'LHA l /x ARC' shows full-pathnames of FILE(s) in ARC, and in 2 lines per FILE. You need not type 'l' to have the list.

<Example 11> LHA LHA213.EXE

LHA assumes command 'l' and shows list of FILE(s) archived FILE per line.

< Example 11x > LHA /x LHA213.EXE

You get a similar list but full-pathnames are inserted, and each FILE is shown on two lines.

NOTE: Forward slash '/' is used as the pathname separator.

v (View)

'LHA v ARC' is the same with 'LHA l /x ARC'.

t (Test)

Check the integrity of ARC, by CRC check.

will announce the authenticity of the file you own.

"This file seems to be ORIGINAL distributed from H.Yoshi."

LHA.EXE tests itself for you. This guarantees the version you have is not hacked by anyone, though it is not the full guarantee in the present state of art. You can't check LHA.EXE if you have used executable file compressors such as LZEXE, PKLITE or DIET.

< Example 12 > LHA t EX
LHA tests integrity of the FILE(s) in 'EX.LZH'.

< Example 13 > LHA t LHA.EXE
LHA checks if LHA.EXE is the original file distributed.

It has often been asked that files made by LHarc v 1.xx fail this test. You cannot test LHARC.exe with this test. If you get an answer "file corrupt", don't get panic. These files often have extra padding in the back of the file.

s (Self-extract)

LHA makes a Self-Extracting archive from ARC.LZH. The default switch /x0 is assumed when you do not specify. SFX made with the /x0 switch, small model, extracts files on the current directory. You can't activate some programs in the archived FILE(s) automatically with small model. The size of the SFX file is smaller than those made with /x1 switch, large model.

The large model SFX has the ability to restore subdirectory structures and can automatically start execution from a FILE inside the archive.

< Example 14 > LHA s EX

In this case, LHA makes a small model EX.EXE from EX.LZH.

We had many inquiries that LHA does not make SFX file. You must first make LZH file by 'a' or 'm' command. Then you use 's' command to make it a self-extracting file.


Each option takes 3 numerical values to define its finer actions. Use 0, 1 and 2 to specify. For some options, the values 1 and 2 does the same thing. You may toggle 0 and 1 by '+' and '-" as with LH113c. You may change switch character (option) from / to - if you prefer the '-'.

/x[0|1] (eXtend)

LHA uses eXtended FILE names, namely full-pathnames for FILE(s).

You are on the root directory. Suppose you want to archive the FILE '\tc\include\sys\stat.h' in an archive 'ARC.LZH'. You type 'LHA a /x1 ARC.LZH \tc\include\sys\stat.h' to store the FILE with full-pathname,'\tc\include\sys\stat.h'. Similarly, you have a 2-lined list with full-pathnames with 'l' command.

/p[0|1|2] (Precise)

Search file names precisely.

Suppose an ARChive 'TC.LZH' contains both 'STAT.H' and 'SYS\STAT.H'. A simple command like 'LHA e TC stat.h' will extract both files on the current directory and let one override the other. To avoid such confusion, you can type 'LHA  e -p TC stat.h' to extract 'STAT.H' only. While by typing 'LHA e -p TC sys\stat.h' you will get 'SYS\STAT.H'.

/c[0|1|2] (ignore Comparison of time)

With commands 'u', 'f', 'e', 'x', LHA ignores the checking of time stamps. With these commands, LHA chooses the newest FILE with the same pathname to act on, by default. This option lets LHA ignore the time stamps.

/m[0|1|2] (no Message)

The switch '/m1' let LHA assumes answer 'Y' for all the queries. "LHA e /m1 ARC" will extract files in ARC.LZH wherever "Y" is typed for the queries "Overwrite? [Y/N]" are asked. If there is a file in the directory with the same name but with attribute read-only, LHA reports 'file creation error'. Similarly LHA creates new directory if it meets 'Directory DIR does not exit. Create [Y/N]'.

On the other hand, with '/m2' switch LHA acts differently. 'LHA e /m2 ARC.LZH FILE' dearchives every FILE by choosing an unused file extension among 000-999, when LHA finds FILE(s) with the same name as in the ARChive.

/a[0|1] (any Attribute)

This switch enables LHA to archive FILE(s) with any attributes.

In the process of archiving with default switch /a0, LHA will not archive FILE(s) with hidden and system attributes. FILE(s) with read-only attribute is archived with the attribute. With this switch on, '/a1', FILE(s) of any attribute are archived

In the process of dearchiving, with /a1, dearchived FILE(s) preserve their original attributes. With /a0, you can't dearchive files with hidden and system attributes. Read-only FILE(s) are dearchived deprived of their original attribute.

/r[0|1|2] (Recursive)

LHA archives and extracts files recursively from subdirectories. 'Recursively' means LHA searches all FILE(s) from all subdirectories under the specified directory if there is any.

There are three different modes for the '/r' switch.

/r0: (non-recursive mode, default)
LHA collects files specified by path names only.

LHA separates the given pathname into a directory name and FILE name. LHA recursively collects FILE(s) with the given name from all the directories under the directory specified.

< Example 15 > LHA a /r1 SOURCE.LZH \SOURCE.C\SOURCE\*.H

LHA collects FILE(s) with extension C and H from the directory \source and its subdirectories, probably '\SOURCES\SAMPLES\*.C' but not '\SOURCE\*.OBJ'.

LHA recursively collects all the files from all the specified subdirectories. Tree structure of the specified directory is archived as it is.

< Example 16 > LHA a /r2x1 a:\*.*

NOTE: LH113c has set /x whenever /r is set in 'e' or 'x' commands. LHA differs from LH113c in that /x is not set with /r automatically.

The following questions are the most frequently asked ones:

1. How do you backup a disk a: ?
LHA a /r2x1 LZH a:\

2. Then how do you retrieve all the directories and files on b:?

/w[0|1|<Directory Name>] (Work directory)

Specify the directory name where LH makes temporary files.

LHA a /wd:\ ARC.LZH FILE(s)

set -w switch on.

By default, LHA makes all the temporary files on the directory where ARC.LZH is to be made. It will rename the temporary file as ARC.LZH.

LHA makes temporary files on the current directory if no name is specified with '/w+'.

When you set Environmental variable 'TMP' this switch is set automatically to be 1, and you have the directory set by 'TMP='. as your working directory.

The switch helps LHA when you have not enough room in your base directory, or when you have a high speed memory device like RAM disk or HARD ram.

/t[0|1] (Time stamp)

With command a,u,m,f,d reset time stamp of ARC.lzh according to the newest file in the archive. By default, the time stamp of an ARC.LZH is the time when the ARC.LZH is made.

/z[0|1|2] (Zero compression)

LHA makes an archive without compressing.

/z1: None of the FILE(s) is compressed

/z2: Compress and archive except for the FILE(s) with extensions:


/z<extension>: Do not compress FILE(s) with the specified extension. This switch assumes /z2. You may use wild card to specify, and you may or may not put '.' in front of the extension. With '/zdbf' you don't compress FILE(s) with extension '.DBF'. With '/z' you will not have FILE(s) with no extension compressed. You may specify multiple extensions by writing sequentailly:

LHA a /ZCOM /ZERO ARChive.LH *.*.

/o[0|1] (Old compatible compression)

LHA makes an archive compatible with the LH113c format. Even in this case, LHA makes tighter compression than LH113c ver 1xx. The header id is automatically set to -h1.

/h[0|1|2] (Header level)

Choice of header level, default is /h0.

/i[0|1] (don't Ignore case)

Recognize Upper and Lower cases. LH(arc)s have common header format in other OS's where cases are recognized as distinct. This option is prepared for dearchiving archives made by other OS'. In the DOS version of LHA, you can't differentiate upper and lower when LHA archives FILE(s) into the archive. Names are all stored in upper case.

/n[0|1|2] (No indicator)

In this version, LHA outputs compressing indicator "ooo....."  to standard error. The switch is to suppress this output.

/n1: LHA disables output "ooo....." to indicate its progress.
/n2: LHA disables outputs of filename, compression rates.

/l[0|1|2] (Long display ).

LHA outputs filenames in different formats when LHA archives
and dearchives.

/l0 : FILE names only.
/l1 : Full-pathnames stored or to be stored in archive in 2 lines.
/l2 : Full-pathname of FILEs accessed by LHA in 2 lines.

< Example 16 > LHA a /r1x1l2 LINK.LZH c:\LINK.*

LHA collects LINK.* with full-pathname from directories below c:\, with information from where LHA gets this FILE(s).

/-[1|2] (The first letter switch).

LHA recognizes the characters '-' and '@' as the first letter of a FILE name. By default, any file beginning with '@', like '@xxx' is recognized as a Response File 'xxx'. 

'/-1' switch LHA reads '@' as a character in the file name, while with switch
'/-2' LHA recognizes both '-' and '@' as characters.

To exit from this mode specify '/-[0]'. You cannot use '--0' in this particular case. LHA believes '--0' as a file name.

/s[0|1] (refrain from "Skipped filename.ext" message).

When LHA finds a file with the same name with newer time stamp, LHA skips decompressing a file from an ARChive. This message may cause some confusion in Batch mode execution. You may suppress the display. New from this version 2.13.

Base Directory

Base directory is not the current nor the root directory. It is the directory on which LHA is executed. Or you may believe that you move to this directory and execute LHA from there. You may specify a number of directories as your base directories.

< Example 17 > LHA x program c:\BIN\ *.EXE *.COM c:\TEMP\ *.MAN *.DOC

Suppose you are on the directory d:\. You want to extract files with extensions .COM and .EXE on c:\BIN, and those with extensions .MAN and .DOC on the directory c:\TEMP. This is equivalent to the following set of command lines:

C>LHA x D:\program *.COM *.EXE
C>cd \TEMPp
C>LHA x D:\program *.MAN *.DIX

Naturally, you can't dearchive a single FILE on multiple directories. The directory specified first has the priority.