KERMIT 95 - FREQUENTLY ASKED QUESTIONS

As of K95 Version: 2.1.3
This File Last Updated: Fri Oct 17 12:18:48 2003

CONTENTS

Invoking Kermit 95 from: [ Visual Basic ] [ Java ] [ C++ ]


THE NATURE OF THE PRODUCT

[ Next ] [ Previous ] [ Top ]

Is Kermit 95 Buzzword-1.0 Compliant?
Most likely. It is Year-2000 Compliant, Euro Compliant, it uses all the latest open security standards and libraries. It implements numerous open Internet protocols. It is Common Off The Shelf commercial software (COTS) and therefore automatically complies with most procurement rules. It is approved for export to all but the seven embargoed countries. For vendor qualifications and data, CLICK HERE.

What exactly is the documentation for Kermit 95?
Unlike most other Windows-based communication software, K95 is not a Windows-only product, but just one of a suite of similar programs for many platforms: Linux, AIX, VMS, Solaris, etc. Collectively, these programs are called C-Kermit (a Kermit program written in the C programming language). Most of the features of these programs are shared and identical across all platforms. These features are documented in:

Using C-Kermit
A 622-page book describing C-Kermit 6.0 (December 1996) and the platform-independent aspects of the concurrent version of K95 (1.1.8) including the command language, serial and network connections, file transfer, client/server operation, character set conversion, and script writing for automation, plus sections on troubleshooting, tutorials on data communications, and tons of reference material. Until a new edition is published, this book remains the fundamental reference for the command and scripting language of C-Kermit and Kermit 95. You can also find a scripting tutorial with lots of examples HERE.

C-Kermit 7.0 Supplement
Thorough documentation of the new features of C-Kermit 7.0 (January 2000) and the platform-independent aspects of K95 1.1.17, which was the first version to include secure authentication and encryption, and in which the command language was greatly extended by the addition of "switches" (command modifiers), and which was the first version to support Unicode (the Universal Character Set), plus other changes too numerous to list here.

C-Kermit 8.0 Supplement
Thorough documentation of the new features of C-Kermit 8.0 (February 2002) and the platform-independent aspects of K95 2.1, principally the new FTP, SSH, and HTTP clients or interfaces, plus tons of scripting improvements.

At some point a new edition of Using C-Kermit will be issued, incorporating the new material.

Then, each major C-Kermit platform (Unix, VMS, Windows, ...) has its own platform-specific manual. The manual for Kermit 95 is included with K95 itself, and is accessible from Kermit 95 by:

The Kermit 95 manual concentrates on the Dialer (how to graphically set up and launch connections) and the Terminal Emulator (terminal types, scrollback, key mapping, colors, local printing, character sets, etc).

In addition to the K95 manual, K95 also includes a great deal of other documentation, including the C-Kermit 7.0 and 8.0 manual supplements, linked to from the K95 manual. You can also find a brief tutorial for K95 HERE and another for C-Kermit HERE.

Those who purchased shrink-wrapped copies of K95 through version 1.1.17 received a printed copy of Using C-Kermit. Those who purchased shrinkwrapped copies of K95 1.1.20 received a PDF version of the book on CDROM. Due to renegotiated agreements between publishers, the new Kermit 95 2.1 package (January 2003) does not include the PDF version of Using C-Kermit, but it does include a license key to let you download it (note: this applies ONLY to owners of the K95 2.1 shrinkwrap). Electronically delivered versions of K95 do not include the Using C-Kermit book because:

  1. It would triple the size of the download;
  2. It would increase the price, since each copy of the book (printed or electronic) must be paid for;
  3. The new GUI version of K95 does not require users to know the command language for normal operation.

This is the primary reason that the cost of the electronically delivered version of K95 is so low. The shrinkwrapped version costs more.

It is expected that the PDF version of Using C-Kermit will also be available for purchase as an "e-book" from the publisher, Digital Press, or an authorized agent; the details are not yet available as of this writing (January 2003).

What's going on with the OS/2 version?
K95 2.1.2 is available for IBM OS/2 3.0 and later with certain restrictions: Console only (no GUI); no SSH, no Kerberos. K95 1.1.21 and 2.0 were not available for OS/2, but we did succeed in building version 2.1.2 for OS/2, complete with FTP client, and the Kermit 95 2.1 shrinkwrap package includes the OS/2 version. (2.1.3 is not available for OS/2 but most of the changes relate to the GUI controls, which the OS/2 version doesn't have anyway.) The OS/2 version does not include SSH because OpenSSH libraries are not available that are compatible with the OS/2 K95 development tools.

Why isn't Kermit 95 free?
Kermit 95 is developed, documented, and supported by full-time computer professionals at Columbia University's nonprofit Kermit Project. Revenue from Kermit 95 sales and licenses is the only source of funding for its continued development and support. Paying for Kermit 95 gives you the right to the time, attention, support, and respect of Kermit professional staff, which is something you can't count on with free software nor, as some of our users tell us, with much commercial software either. For more about Kermit and free software, CLICK HERE.

Why is the product (still) called Kermit 95?
All Kermit Project software has "Kermit" in its name. Kermit 95 was originally written in 1995 for Windows 95, and was therefore given the obvious name. However, unlike Microsoft, we chose to stick with the original name as new versions came out because it's quite difficult to refer to a product generically, regardless of version, when each version has a different name. Those who feel that the "95" in "Kermit 95" dates it should think of the "95" as a part number or model designation rather than a year or version number, and of K95 as a faithful and effective tool in the spirit of the similarly named P38 (Army tool for opening C-rations).

As for "Kermit"... This name was chosen on a whim back in 1981, before we had any idea that Kermit protocol or software would ever escape the bounds of Columbia University or remain current and popular for decades. The whim, in turn, was based on (a) a Muppets calandar on the wall when we were searching for a name, and (b) the fact that some of us had small children addicted to The Muppet Show. Although a name like "Kermit" might have certain drawbacks in today's fast-paced, high-powered software marketplace, it also has (we think) a certain charm and simplicity: It's easy to say, easy to spell, and utterly lacking in hyperbole and condescension. But if you prefer, feel free to refer to K95 as:

UltraHyperExtremeTurboCyberOpenEnterpriseSmartSecureE-CommercePowerPro-2003 Gold

Can I use MS-DOS Kermit instead of Kermit 95?
Under certain conditions, yes, but not for TCP/IP connections, not with Plug-n-Play or PCMCIA modems, not with Winmodems or RPI modems, not with ISDN modems, not with nonstandard communication ports, not with devices that are owned by TAPI, etc. Even then, remember it is a DOS program, not a Windows or OS/2 program, and can not take advantage of, or access, special features of Windows or OS/2 -- long filenames, the mouse, the clipboard, secure connections, etc. If it works for you, meets your requirements, and requires no technical support then by all means use it on your own PC or within your company, but remember, you can't furnish MS-DOS Kermit to customers or clients without a license, any more than you could K95 or C-Kermit.

Do Kermit 95 and the Dialer work in all 32-bit varieties of Windows?
Yes, except for Windows CE (Pocket PC). The same executables run on Windows 95, 98, ME, NT, 2000, and XP on Intel (PC) architecture. In previous releases, K95 was also available for Windows NT on the Alpha and PowerPC architectures, but those Windows versions have been discontinued.

Why not Windows CE or Pocket PC?
Because Windows CE and Pocket PC do not offer the full range of Win-32 APIs. Many of those that are missing are required by Kermit 95.

Can K95 be used with speech and Braille devices?
Kermit 95 should be compatible with any speech or Braille device that can be used in a Console or GUI window. Typical settings are:

  set bell audible                     ; Make sure Ctrl-G is audible
  set terminal margin-bell on 72       ; Margin bell like typewriter
  set terminal statusline off          ; For scroll detection
  set terminal screen-update smooth    ; Or "fast" - depends on screen reader
  set terminal screen-optimization on  ; This is the default anyway
  set terminal mouse off               ; Might be required by some readers

In addition, certain keys might need to be set to \Kignore, so they can be used as controls for the screen reader or Braille software. Depending on the specific screen reader, these might be the keys on the numeric keypad. The method for doing all this is illustrated in the ASAP.KSC file, for setting K95 up to be used with the ASAP screen reader.

For related resources, see our links page.


INSTALLATION AND UPGRADE PROBLEMS

[ Next ] [ Previous ] [ Top ]

Kermit 95 2.1 is distributed as a full upgrade installation to those who have earlier K95 versions, no patching required.

Kermit 95 1.1.17 and later are distributed on CDROM. Version 1.1.16 was distributed only in patch form. Versions 1.1.15 and earlier were distributed on diskette. Since the last diskette release was in 1997, we've removed the longwinded discussion of problems with diskettes and diskette drives from the FAQ.

The Trial Version
A full-featured 21-day trial version of K95 is packaged and distributed by our electronic sales and delivery agent, e-academy.com. The trial version is the regular release version with a "Vbox" front end applied to it by e-academy, which consists of a "nag screen" with "Try" and "Buy now" buttons. The Buy Now button lets you pay for and obtain a licensed version of Kermit 95. This version is discounted since (a) there is no physical package and (b) the book Using C-Kermit is not included. Several problems can occur with the VBOX mechanism:

Vbox Error: Failed to initialize Vbox!(0002-0053-0081)
Windows NT, 2000, or XP only, when logged in as a nonprivileged user. Vbox requires Administrator privilege due to the rental feature and the need to update certain files and Registry entries. Licensed copies of K95 do not use Vbox and do not have this restriction, but there is no getting around this issue with the trial version.

Vbox Error: Export function: Duplicate TokenEx could not be found in dynamic library:ADVAPI32.dll. Error code: 127
Most likely you are running original Windows 95 and have never installed any updates. Apparently the "Vbox" registration component uses Windows features that were added after original Windows 95 (Error 127 means that something cannot be loaded). Usually you can work around this by installing updates from Microsoft, such as a newer version of Internet Explorer, which would replace your version of ADVAPI32.DLL with a newer one. Licensed copies of K95 do not include Vbox and do not have this problem.

Other random errors and crashes running the Trial version
Perhaps your download was incomplete. It's a large file, and FTP traffic is one-way only. Maybe your ISP thought your session was idle and disconnected you prematurely. Try checking your mail or browsing the Web in a separate window periodically to make sure your ISP does not think your session is idle.

I can't uninstall the trial version
Depending on how it was installed, you might need to be logged in as Administrator to uninstall it.

I can't uninstall K95 1.1.xx
Version 1.1.20 and earlier were not installed with InstallShield, and so can't be uninstalled using "Add or Remove Programs"; you have to do it the old-fashioned way: (1) Make sure K95 is not running; (2) Start a Command (CMD) or "MS-DOS" window; (3) type "cd \k95" (or CD to whatever other directory you installed K95 in); (4) Type "cd .." to go up one level; (5) Type "deltree k95" or "del /s /q k95" (depending on which OS you have).

CDROM installation doesn't start
In Windows 95/98/ME/NT/2000/XP, loading the Kermit 95 CDROM into your CDROM drive should activate the Windows "Autorun" feature: a few moments after Windows has compiled the CDROM directory, it pops up the Kermit 95 installation procedure automatically. If this does not happen to you, access the CDROM as though it were a regular disk, CD to the I386 (Windows/Intel) or other appropriate directory, and start the Setup program.

CDROM installation fails
Typical example: Installation starts, web page comes up; upon clicking back to InstallShield Wizard, it is solid grey, except for the title bar, and the cursor is an hourglass. Shut down all your applications, reboot, and try again, making sure that your anti-virus and intrusion detection software is disabled. Antivirus software often panics when a software package is being installed.

My PC doesn't have a CDROM drive!
If you purchased the K95 retail package but your PC does not have a CDROM drive, please contact us for instructions.

I downloaded a K95 upgrade but it won't install!
Did you download the right upgrade? Read the download page carefully to make sure you picked the right file to download. If the upgrade file failed to execute at all, be sure you downloaded it in binary mode and that the download completed successfully. Remember that you can't install the upgrade unless you have a previous Kermit version installed on the same PC. If the installer can't find it, it gives you an opportunity to specify its location.

Occasionally it happens that the Upgrade Installer reports it can't find a licensed version, and offers to let you browse to the location, but even when you choose the registered copy of the K95.EXE executable, it reports failure. This seems to happen only when you chose the "Don't make Registry entries" option when you installed your original version. If you remove your old version and reinstall it, but this time choose to make Registry entries, then the Upgrade Installer should be able to find it.

One user reported that the Upgrade Installer complained (on Windows 2000) "No valid Kermit 95 installation in C:\K95, try a different path". Repeated attempts to run the installer said the same thing. Rebooting didn't help. Downloading a fresh copy of the installer didn't help. He shut down and turned off the machine and went home. The next morning when he turned on the machine and tried the procedure again, it worked.

I installed K95 2.x but the icons didn't appear on the desktop
Click your mouse on the desktop and then press the F5 key to refresh the desktop, or right-click on the desktop and choose Refresh.

I can't reinstall from my original K95 media!
In case you uninstalled K95 for some reason and then want to reinstall it (e.g. so you can upgrade to K95 2.1), you might run into problems. For example, if you bought Kermit 95 prior to version 1.1.17, it was distributed on diskette; maybe you don't have a diskette drive any more. Another problem is that the K95 SETUP program for version 1.1.10 and earlier doesn't work on disks larger than 2GB; in that case you can manually unzip the K95PACK*.EXE files and then run CKREG.EXE to register it. Then you can install the upgrade.

If all else fails, we would appreciate it if you would simply buy a new version; discounted copies are available on the Web from e-academy.com. Due to the harsh economic conditions, we no longer have sufficient staff to help people one-on-one with relatively ancient Kermit releases. Most other companies would have made you pay for upgrades all these years, and we never have -- which might be part of the problem!

I lost my serial number!
If you sent in your registration card, we have a record of your serial number. If not, you'll have to provide convincing proof of purchase before we can help you.

Kermit 95 starts but is hung
The first time you start Kermit 95 on a PC that has never had a modem configured, Windows pops up a dialog box for you to fill in your country and area codes and Kermit can't finish starting up until you complete this dialog. If the dialog box is hidden behind another window and you don't see it, it will seem that Kermit is hung. Use Alt-Tab, Alt-Esc, or the menu bar to cycle the dialog to the front, fill in the requested information and close the dialog box, then Kermit 95 will finish starting.

Kermit 95 starts but has weird dimensions
Kermit 95's screen presentation (GUI version, K95G) depends on the font and size, which are selectable in its Toolbar. Depending on your monitor, driver, and Windows display settings, some font/size combinations result in an ugly, useless, and/or bizarre presentation. The first time you start K95G, it picks a font and size for you, and the choice can't always be optimal. Choose a font and size that gives good results on your monitor. K95G remembers your choices and, absent instructions to the contrary, uses them next you start it.


INITIALIZATION AND CUSTOMIZATION FILES

[ Next ] [ Previous ] [ Top ]

How do I edit my K95 customization file?
Kermit 95 1.1.20 and earlier had all their files in one simple directory tree, typically C:\K95, which made it very easy to find your K95 initialization and customization files. Subsequent versions changed to the complex structure mandated by newer versions of Windows, in which the program files go in one place, program data for all users goes in another, and program data for each user goes in yet another. The names of these places vary from one Windows version to another, and from one country to another.

When people ask how to accomplish a certain customization, we give them a command (or list of commands) to do it. The next question is invariably, "where do I put these commands?" The answer is, "If you want them in effect for all your K95 sessions, put them in your customization file," meaning: edit your K95CUSTOM.INI file to include the desired commands. In early K95 versions, you could find this file in the same directory as K95 itself. But now where is it??? This is thoroughly explained in in the K95 Read Me document, but here is a simple recipe for how to edit your K95CUSTOM.INI file, wherever it is, in K95 1.1.21 or later. Start K95G or K95, then:

K-95> kcd appdata
K-95> run start notepad k95custom.ini

Remember, Kermit command files should be edited only by plain-text editors such as Notepad, DOS EDIT, or EMACS, not word processors like MS Word.


THE K95 DIALER

[ Next ] [ Previous ] [ Top ]

The Dialer is the graphical front end for Kermit 95. It is built using a portable GUI builder that creates versions for both Windows and OS/2.

Do I have to use the Dialer?
No. If you are comfortable typing commands (or creating command files, macros or scripts) for Kermit 95, you don't need to use the Dialer at all. The Dialer is recommended to newcomers to Kermit, since it makes it easy to set up any kind of connection. Some Kermit veterans prefer to use Kermit 95 directly.

What happened to the nice entry notebooks that we had in K95 1.1?
All the new pages (SSH, GUI, FTP, etc) made the notebook too big for Windows 9x/ME. For a detailed explanation CLICK HERE.

Why does it take a few seconds for the Dialer to start?
Because:

How do I get rid of unwanted Dialer entries?
You can not remove an individual predefined entry with the Remove button. However you can hide all the predefined entries by going into the Dialer's Options menu, selecting View, and then unchecking "Pre-defined". If you want to keep some of the predefined entries, just edit the ones you want to keep; this makes copies of them that are still visible even if you uncheck Pre-Defined. NOTE: This question is largely irrelevant in K95 1.1.21 and later, in which all the old and mostly defunct predefined entries (hundreds of them) were retired.

What are all the .DAT files?
Most of .DAT files in the Kermit 95 directory are used by the K95 Dialer:

DIALER.DAT
Contains the GUI screen definitions for the Dialer. It must not be renamed or deleted. A particular version of K95DIAL.EXE is keyed to a particular version of the DIALER.DAT file.

DIALINF.DAT
Contains the preloaded Dialer entries. This file is "read-only", primarily because it contains templates that are used for constructing other entries. (NOTE: In version 1.1.20 and earlier, this file contained hundreds of BBS and Telnet sites that by now are defunct; these have been removed to reduce the clutter -- if you need them send us e-mail.

DIALORG.DAT
(If any) Contains the preloaded Dialer entries for your organization. This file can be created by organizations that have K95 bulk or site licenses. Like DIALINF.DAT, this file is read-only.

DIALUSR.DAT
Contains (a) entries that you have added; (b) preloaded entries that you have edited; and (c) the information from your File and Options pages.

The remaining .DAT files are associated with the GUI setup and registration programs.

Why is my K95CUSTOM.INI ignored when I launch a connection from the Dialer?
Your K95.INI and K95CUSTOM.INI files are indeed executed, but the commands that come from the Dialer are executed after them, so when there is a conflict the Dialer settings override the INI-file settings. Make sure your Dialing Options menu notebook contains the desired settings, and also the notebook pages for the entries in question. The primary purpose of the INI files in K-95 is for when you start K95.EXE without the Dialer (or for key or macro definitions that you always want to be in effect and that don't conflict with settings made in the Dialer). As a last resort, you can enter commands into the Login Script text box in the Dialer entry -- the commands in this box are executed last.


STARTING AND STOPPING KERMIT 95

[ Next ] [ Previous ] [ Top ]

Why does Kermit 95 take a few seconds to start?
K95.EXE can take a while to start because:

If you use K95 to make different types of connections, not just TAPI, take the TAPI-related commands out of your K95CUSTOM.INI file.

The following command-line options can be used to tell K95 not to load certain DLLs; this can speed startup:

These numbers are powers of 2, representing single bits, and can be added to form a "bit mask" of options. Thus "-# 30" means don't load any of the above. On a 90 MHz PC, starting K95 1.1.16 with "-# 30" took about 1 second; without it about 4 seconds. You can omit the network DLLs if you will not be making network connections. You can omit TAPI if (a) you will not be making dialout connections, or (b) you will be using COM1 or COM2 directly rather than the TAPI modem device (i.e. the Control Panel name for the modem). You can omit Kerberos DLLs if you will not be making secure connections with Kerberos authentication. You can omit the XYZMODEM DLLs if you will not be transferring files with XMODEM, YMODEM, or ZMODEM.

Why does it take K95 several seconds to exit?
K95.EXE might take a while to exit because:

It can take Windows 20-30 seconds to release the TAPI device if your modem is disconnected or powered off. When it is connected and turned on, it still can take 5-10 seconds. That's Windows, not Kermit, being slow. If you can use the SET PORT COMx / SET MODEM TYPE xxx interface instead of the TAPI one (which is possible only for standard COM ports, not Winmodems, etc), opening and closing of modems will be faster.

K95 won't start because "Cannot create crypto provider service"
The PROV_RSA_FULL Cryptographic Service Provider, which is one of the sources of randomness used to secure SSL/TLS and SSH, is either not installed on your machine (when it should be) or is inaccessible to your account. If you get this message, first make sure you have the current release of K95; if not, upgrade; if so, contact us.

How can I make K95 start in a given screen location?
The GUI version (K95G) accepts --xpos: and --xpos: command-line options. Arguments are in pixels and so depend on your PC's graphics resolution. You can put these in a .bat file or a shortcut. The GUI version also has a SET GUI WINDOW POSITION x y command to let you specify the screen location in a script. You can also specify the startup location for any connection in your Dialer database, on each entry's GUI Settings page.

How can I run a K95 script with arguments?
From a command window or Batch file:

  k95 scriptfilename arg1 arg2 arg3 ... 

Specify the full pathname of K95 (or K95G) if it is not in the PATH. Specify the full pathname of the script file if it is not in the current directory.

In a shortcut to K95 or K95G you can put the script file name and arguments after the Kermit 95 executable name in the Target box of the Shortcut properties.

In a shortcut to a Kermit 95 script file, you can put the arguments to the script after the script file name in the Target box of the Shortcut properties.

From the Kermit 95 prompt, or within a Kermit 95 script, you can use the TAKE command, followed by the script file name, followed by its arguments.

How can I mix K95 arguments and script arguments on the command line?
Give the script file name as the first command-line argument. Then the K95 command-line arguments. Then an equal sign (=), and finally the arguments for the script. Example:

  k95g oofa.ksc --xpos:500 --ypos:500 = "This is script arg 1" scriptarg2

How can I run a K95 script by clicking on a URL?
Just make sure the script file name ends in ".ksc". Then use a URL (ftp:, http:, file:, whatever) that points to the script. Examples:

  http://www.columbia.edu/kermit/helper.ksc
  ftp://kermit.columbia.edu/kermit/scripts/ckermit/helper.ksc

How can I start K95 minimized?
You can do this in a Shortcut -- edit the properties and Choose Minimized (Console version only, not GUI). You can also start the Console version minimized with the Windows command START /MIN. This is useful for running Kermit scripts that don't need to interact with the user:

  @start /w /min "C:\Program Files\Kermit 95 2.1\k95.exe" scriptname = args...

K95 2.1.3 and later also have a --minimized command-line option (--maximized too).

Can I run K95 in a shell window of Windows EMACS?
Yes. You have to use the Console version (K95.EXE, not K95G.EXE). Start it like this (96 = 32 + 64, the codes for "use standard input" and "use standard output"):

  k95 -# 96

You can use it to make any kind of connection that you could make from a regular window: Telnet, SSH, Dialout, FTP, etc, and you can transfer files over the connection in the normal way.

The only fly in the ointment is that your keystrokes are read by EMACS, not K95, and EMACS intercepts Alt keys, F keys, and all Control characters, and furthermore, doesn't pass your keystrokes to Kermit until after you press the Enter key, so command-line editing (e.g. Ctrl-U), completion (Esc or Tab), ?-help, etc, don't work as they do when K95 has "direct access" to the keyboard. Escaping back from CONNECT mode is a bit tricky too; you have to type:

  Ctrl-Q Ctrl-] c CR

That's Ctrl-Q followed by Ctrl-Rightbracket, then the letter C, then press the Enter key. In fact, every control character is intercepted by EMACS, so to pass it through to Kermit you have to quote it with Ctrl-Q, and you probably also have to hit Enter afterwards.

And of course, when K95 is using stdio, there is no terminal emulation, so you can't (for example) run EMACS in your CONNECT session to the host :-)

But on the plus side, your CONNECT session is an EMACS buffer, so you can move around in it, edit it, etc, with regular EMACS commands.


SERIAL CONNECTIONS, MODEMS, AND DIALING

[ Next ] [ Previous ] [ Top ]

Can K95 dial my ISP?
Because of Kermit 95's flexibility and programmability, many people ask us if there is a way that Kermit 95 can be used to make Dial Up Networking connections, in place of the standard Windows way. A variation on this question is: since Kermit can make modem calls, can I use it to make dialed connections to FTP servers? Unfortunately, the answer is no; Microsoft does not provide a way to let an application make a connection to a PPP or SLIP or FTP server (or Microsoft Windows Terminal Server) and then turn the connection over to the TCP/IP (or other network protocol) stack. The only way in Windows 95/98/ME or NT/2000/XP to make a dialup networking connection is with the built-in Dialup Networking dialer or (in Windows NT) RAS (see notes about RAS HERE). OS/2, on the other hand, allows this and Kermit 95 for OS/2 has this feature for both PPP and SLIP.

Will K95 let my PC accept incoming calls?
Sure. Of course you can't dial and log in to Windows and get a text-based shell like you can do with VMS, Unix, and other conventional operating systems -- Windows was not designed to allow that. But you can still set up Kermit on Windows to accept incoming calls and provide a file-transfer and management service. There are various ways to do this, of which the most user-friendly, called host mode, is described HERE.

You can also write a simple Kermit script that awaits and handles incoming calls, something like:

set port tapi
set speed 57600
set flow rts/cts
while true {
    cd some-directory
    answer 0
    if success {
        server
        hangup
    }
}

Obviously many variations and refinements are possible.

My connection fails with "ttsetspd failed"
When you make a connection with a modem, the modem reports the connection speed with a message like "CONNECT 31000". Usually this is the speed between the two modems, not the speed between your modem and your PC. In some cases, however, it can be the speed between your modem and your PC, depending on your modem make and model and configuration. In that case, Kermit has to change its interface speed to match the one reported by the modem. The classic example is the Hayes 2400 SmartModem -- if you dial it at 2400 bps, but the other modem supports only 1200 bps, your modem has to drop its speed down to match. This many years ago, in before the days of hardware flow control and "speed buffering". Nevertheless, Kermit has a setting to provide for this behavior, since some people still need it. The setting is:

set modem speed-matching { on, off }

SPEED-MATCHING ON means that Kermit should change its interface speed to match what the modem reports. Of course this setting is OFF by default.

The problem happens when Kermit's SPEED-MATCHING setting in ON but the modem is not really changing its interface speed. Then Kermit tries to change its interface speed to the one reported in the modem's CONNECT message. If it succeeds, you won't have any useful communication because the two interfaces are set to different speeds. If it fails ("ttsspd failed") it's because the reported speed (e.g. 31000) is not a legal interface speed.

This happens most commonly when you SET PORT TAPI to use Microsoft's built-in modem database, but the database erroneously calls for speed matching. The solution is to tell Kermit to SET MODEM SPEED-MATCHING OFF after you have selected the TAPI modem:

set port tapi
set modem speed-matching off

SET PORT COM3 doesn't work!
SET PORT COM1, COM2, COM3, etc, works only with real serial ports. It won't work with Winmodems and the like, because they are not COM ports. Make sure the device shows up in the Control Panel's Modems folder and then use SET PORT TAPI rather than SET PORT COMx to access it.

Unfortunately, COM ports (or their modern substitutes) usually do not show up in the Control Panel Phone and Modems folder by default. If this is the case on your Windows PC:

  1. Click Start → Settings → Control Panel.
  2. Open the Phone and Modem Options item.
  3. Click the Modems tab on top.
  4. Click the Add button.
  5. When the Wizard appears, click the check box that says "Don't detect my modem..."
  6. Click Next.
  7. Under (Standard Modem Types) you should see: "Communications cable between two computers" listed; select this and then click Next.
  8. Choose the COM port you want to use (such as COM1), then click Next.
  9. Once the Wizard completes, click Finish, you should see the new item.
  10. Close out of the Phone and Modem options, close Control Panel.

Now when setting up Kermit 95, instead of using:

set port com1   (or com2, etc)

Use:

set port tapi Communications_cable_between_two_computers

If you have more than two COM ports, you might also have an interrupt conflict, since PCs have interrupt slots for only two COM ports. Solving PC interrupt conflicts is beyond the scope of this document.

Kermit vs TAPI Dialing
There are two ways to dial TAPI modems. The default method is to have the Windows Telephony (TAPI) subsystem configure and dial the modem (SET TAPI MODEM-DIALING ON). If you want Kermit to dial the modem itself (or you want to interact with the modem by hand in CONNECT mode) you must tell Kermit to SET TAPI MODEM-DIALING OFF before you open the port:

SET TAPI MODEM-DIALING OFF
SET PORT TAPI device-name
SET SPEED 57600                   ; Or other desired speed
DIAL number>

Or if you want to dial the number by hand:

SET TAPI MODEM-DIALING ON
SET CARRIER-WATCH OFF
SET PORT TAPI device-name
SET SPEED 57600                   ; Or other desired speed
CONNECT                           ; Enter terminal screen
AT                                ; Now maybe you can type modem commands
OK

By-hand dialing is not guaranteed to work with TAPI modems. Who knows, maybe the modem and its driver use some secret dialing protocol instead of AT commands.

How do I use K95 with Cincinnati press brake machines?
We have a whole FAQ for just this topic; CLICK HERE to read it.

How can I make credit-card calls?
This applies when you have defined a dialing location in TAPI that includes a credit card number.

If you are using the K95 Dialer:

  1. In the Dialer's main menu, choose Options.
  2. Choose Dialing.
  3. Make sure that both TAPI Modem Dialing and TAPI Phone Number Conversions are checked.

Then when placing a call, make sure:

If the phone number is not in portable format, neither Kermit nor TAPI will be able to apply any prefixes or suffixes, including the credit card number. (This process is referred to as "Phone number conversions" in the menus.)

To create a new TAPI Location that uses a Credit Card:

Now when you dial, these dialing rules -- including the calling card number -- will be used.

Can K95 make connections through the parallel port?
In Windows NT, no; in Windows 95, 98, ME, 2000, and XP, yes. In Windows NT, it is not possible to "set port lpt1" -- i.e. to use a parallel port as a communications device, because bidirectional parallel ports are not supported by the NT drivers. But they are in Windows 95, 98, ME, and 2000, which include a COM-to-LPT interface. So in Windows 9x or 2000, you can:

  SET PORT LPT1

(or other parallel-port device). Only DOS names are allowed. Parallel ports (like Serial ports) are not automatically installed as TAPI devices since they are not modems. If you want a parallel port installed as TAPI device you must manually install it as a "Direct Serial Connection" device.

Can K95 use dialout modems on Telnet terminal servers?
Yes, this has always been possible. The command sequence is:

  set host hostname port
  set modem type name
  ...
  dial phone-number

However, since the modem is at the other end of a Telnet connection, you would not normally be able to control its serial-port settings. But if the terminal server supports RFC2217 Telnet COM Port Control K95 can do everything it could do with a local PC COM port: set the serial port interface speed and flow control method, sense modem signals, control the DTR signal, send BREAK, etc.

Can K95 be used with ADSL modems?
ADSL modems are generally used to make Internet connections. Kermit 95 can be used as a Telnet, SSH, Rlogin, FTP, or HTTP client over any Internet connection: SLIP, PPP, ADSL, DSL, Ethernet, you name it.

Does K95 work with Novell NASI modem sharing?
K95 works with any software that provides a TAPI interface or a COM port interface, and should work with any software that exports a Win32 device name. According to the Novell Support Website, http://support.novell.com/ on 24 July 1998, "In order for NT to access the modem pool, WIN2NCS version 2.11 must be used. . . . Windows NT is now supported. However, there is still an issue with the interaction of Win2NCS with Microsoft's TAPI which may cause problems with Host mode on some Remote Control applications. This is currently under investigation." (The download link provided for WIN2NCS no longer works.)

One user reported trouble using NASI until they selected "use hardware flow control always" in the NASI Workstation Global Settings configuration dialog.

Can K95 be used with ISDN?
ISDN (Integrated Services Digital Network) is a digital alternative of the analog telephone system. CLICK HERE for an ISDN tutorial. Kermit 95 can be used with ISDN in the following ways:

Kermit 95 does not include a direct CAPI interface.


NETWORK CONNECTIONS

[ Next ] [ Previous ] [ Top ]

Can Kermit 95 dial my PPP (or SLIP or ADSL) connection?
In OS/2: yes. In Windows, no. Windows provides no mechanism for a user application to turn a modem connection over to the Windows TCP/IP stack. This question is answered in more detail in the previous section.

Will K95 let my PC accept incoming network connections?
Yes. The preferred method for this in Windows NT, 2000, and XP is to install K95 as an Internet Kermit Service, explained HERE. You can also use host mode, which can be used in Windows 95/98/ME as well as NT/2000/XP, and is explained HERE. You can also execute a command such as:

set host /server * 3000

to tell K95 to wait for an incoming TCP/IP connection on port 3000 and then automatically enter server mode when the connection comes in.

Can Kermit 95 be the Telnet helper for my Web Browser?
Yes. This gives you many advantages over the regular Telnet program. Just to name a few: you can transfer files while in your Telnet session; you have more and better terminal emulations to choose from; and you have colors, scrollback, key mapping, and local printing. Simply point your Browser at the TELNET.EXE program in the Kermit 95 directory instead of at regular system Telnet.

Why does Dialup networking pop up whenever I make a Telnet connection?
This is not a Kermit problem -- the same thing would happen with any Internet application, such as Microsoft Telnet or FTP. To fix: open your Windows 95 Dial Up Networking folder (should be in your "My Computer" folder), go to Connections .. Settings .. General and choose "Don't prompt to use Dial-Up Networking".

Why does my Dialup Networking Connection freeze occasionally?
Most likely because you have "Allow OS to power down the NIC to save power" checked in the Control Panel.

How can I force the Telnet server to issue a login prompt?
When K-95 is used to Telnet to a host that whose Telnet server supports the TELNET NEW-ENVIRONMENT option or certain other options, K-95 sends your Windows user ID automatically, unless you have done something to prevent this from happening. In this case, the host does not prompt you for a user ID, but just a password.

If your Windows user ID is the same as your ID on the host you are Telneting to, you only need to supply your password on the host, since it already has your user ID.

However, if they are not the same, or if you want to ensure predictable behavior, e.g. in a script program, you can instruct K-95 not to send your user ID with the command:

  set login userid

(without a user ID). Then the host will give its normal login: or Username: prompt. Put this command in your K95CUSTOM.INI file or your script file, depending on where/when you want it to apply.

How do I make secure Internet connections?
Kermit 95 can make secure TCP/IP connections using SSH v1 or v2 (K95 1.1.21 and later), SSL, TLS, Kerberos 4, Kerberos 5, and Secure Remote Password (SRP) (CLICK HERE for information about secure Telnet servers). The secure connection methods are documented in the Kermit 95 Manual and in several supplementary documents. Secure connections are usually configured by network administrators rather than end users; consult your network administrator to see what forms of security are available at your site and to find out how to configure Kermit 95 to use them if they are among the methods supported by K95. If you are the network administrator and you need assistance, send email to kermit-support@columbia.edu. CLICK HERE for details about Kermit's security methods.

Why doesn't K95 support SOCKS5?
Although SOCKS5 is an open protocol (RFC 1928), the SOCKS5 reference implementation must be licensed for use, which would drive the cost, and therefore the price, of K95 up considerably. To add SOCKS5 to K95 would require a new implementation be written from scratch, something we have not had time to do. If you're a programmer and you want SOCKS5 added to K95, feel free to do the work (by adding it to C-Kermit; K95 shares the same network code); if you're interested in doing this, send us e-mail.

Can I use Kerberized FTP through a NAT?
No, Kerberized FTP uses channel bindings. You cannot successfully use it over a NAT. This is a limitation of Kerberos protocol design.


TERMINAL EMULATION

[ Next ] [ Previous ] [ Top ]

My Backspace Key Doesn't Work!
Please read THIS.

My Arrow Keys Don't Work!
Arrows are not normal characters. There are no arrow characters in (e.g.) the ASCII character set. Therefore terminal makers had to invent codes or sequences for arrow keys to send. Each kind of terminal sends its own special codes or sequences. So the first step in making arrow keys work is to make sure Kermit's terminal type agrees with the host computer's (or application's) idea of what kind of terminal you have. See the Backspace page for details.

But on certain common types of terminals, notably the DEC VT100 series (VT100, VT102, VT220, VT320, etc), arrow keys can be in one of two modes: "Cursor" or "Application". In each mode, they send different codes. Thus, not only must Kermit's terminal type agree with the host, but so must the arrow keypad mode.

By default (that is, unless you give SET KEY commands to change things), Kermit uses the PC keyboard arrow keys as the VT terminal arrow keys. Each key has a "verb" assigned to it:

Key Keycode Assignment Description
Up Arrow \4390 \Kuparr Sends what the terminal's Up-Arrow key sends
Down Arrow \4392 \Kdnarr Sends what the terminal's Down-Arrow key sends
Right Arrow \4391 \Krtarr Sends what the terminal's Right-Arrow key sends
Left Arrow \4389 \Klfarr Sends what the terminal's Left-Arrow key sends

The \Kxxxx's are Kermit Keyboard Verbs (Kverbs). The arrow-key Kverbs track the arrow keypad mode automatically. For example, in VT100-series terminals:

Kverb Cursor Mode Application Mode
\Kuparr CSI A SS3 A
\Kdnarr CSI B SS3 B
\Krtarr CSI C SS3 C
\Klfarr CSI D SS3 D

CSI is ESC (ASCII 27) followed by left bracket ([) on a 7-bit connection or decimal 155 on an 8-bit connection, and SS3 is ESC followed by O (uppercase letter O) on a 7-bit connection and decimal 143 on an 8-bit connection. Thus, as you can see, in VTxxx emulation each arrow key can send any of four different code sequences depending on the arrow keypad mode (Cursor or Application) and Terminal Controls Mode (7-bit or 8-bit).

How does the arrow keypad mode change? The host can change it by sending special escape sequences, or you can change it yourself by using the command:

SET TERMINAL ARROW-KEYS { CURSOR, APPLICATION }

Ditto for Terminal Controls Mode:

SET TERMINAL CONTROLS { 7, 8 }

My Numeric Keypad Doesn't Work!
Essentially the same story as the previous items (Arrow keys). Like the cursor (arrow) keypad, the numeric keypad can be in one of two modes: Numeric or Application. In Numeric mode, it sends what is printed on the keytop (except the Num Lock key). In Application mode it sends special escape sequences. The default assignments of the numeric keypad keys are Kverbs: \Kkp0, \Kkp1, \Kkp2, ... \Kkp9, \Kkp0 for the digits, and:

Key Keycode Assignment Description
Num Lock \4496 \Kgold Sends what the terminal's "Gold" (PF1) key sends
Keypad Slash (/) \4463 \Kpf2 Sends what the terminal's PF2 key sends
Keypad Asterisk (*) \362 \Kpf3 Sends what the terminal's PF3 key sends
Keypad Minus (-) \365 \Kpf4 Sends what the terminal's PF4 key sends
Keypad Plus (+) \363 \Kpcoma Sends what the terminal's keypad comma key sends
Keypad Enter \4365 \Kpenter Sends what the terminal's keypad Enter key sends

Problems occur when the terminal types don't match, the numeric keypad modes don't match, and/or the terminal controls modes don't match. Sometimes when the terminal receives "garbage" from the host, this can change the keypad mode. Relevant commands:

SET TERMINAL TYPE name
SET TERMINAL KEYPAD-MODE { NUMERIC, APPLICATION }
SET TERMINAL CONTROLS { 7, 8 }

The Kverbs that are assigned to the non-digit keypad keys by default vary with the terminal type. This example shows VT100-series terminal assignments. Other types of terminals do not have Gold or PFn keys and therefore have different verbs assigned.

Depending on the terminal type, the digit keys themselves can affected by the keypad mode. When the keypad is in Application mode, they send escape sequences (e.g. in VT100 emulation, the '4' key sends ESC, uppercase letter 'O', then lowercase letter 't'). When the keypad is in numeric mode, they send the digits that appear on their keytops (the '4' key sends the digit '4').

K95's numeric is in numeric mode by default. It can be changed by the SET TERMINAL KEYPAD command or by an escape sequence from the host (or "garbage" that mimics the escape sequence). To get the keypad back in numeric mode, you can:

My Function Keys Don't Work!
Kermit 95 automatically assigns the right codes or sequences to the function keys for the terminal you are emulating. If function keys like F1, F2, etc, don't work, it's either a terminal-type mismatch, or else the terminal is in 8-bit-controls mode and the host isn't receiving or understanding the 8-bit characters. Of course you can also assign anything else you want to function keys with the SET [TERMINAL] KEY command -- commonly-used shell commands, whatever.

Note that VT100-series terminals do not have function keys (although they do have four PF keys). Function (F) keys were introduced to DEC terminals with the VT200. Therefore if you are using Kermit to emulate a DEC VT100 or VT102, don't expect the F-keys to do anything unless you make explicit assignments to them (in this case, K95 treats F1-F4 as PF1-PF4 but F5 and above are undefined).

Higher-numbered function keys can be problematic. For example DEC VT220-series terminals have function keys up to F20, but the PC keyboard only has them up to F12. In this case there must be a mapping. Kermit's default mapping is Alt-F1 → F11, Alt-F2 → F12, ... Alt-F10 → F20.

My Editing Keypad Doesn't Work!
In most terminal emulations, notably VT100 and above but also many others, Kermit's editing keypad performs local functions: Page Up scrolls the screen up to access the Kermit's scrollback buffer, and so on. If you want the editing keypad to act like the one DEC VT220 (or higher) keypad, you can use the Alt-key in combination with these keys, or you can remap them as follows:

set key \4397 \KdecFind    ; Gray Insert    = DEC Find
set key \4388 \KdecInsert  ; Gray Home      = DEC Insert
set key \4385 \KdecRemove  ; Gray Page Up   = DEC Remove
set key \4398 \KdecSelect  ; Gray Delete    = DEC Select
set key \4387 \KdecPrev    ; Gray End       = DEC Prev
set key \4386 \KdecPrev    ; Gray Page Down = DEC Next

This map assigns the functions "positionally", corresponding to the VT220 keys. Of course you can also assign them any other way you want, e.g. according to the keytop legends. Put these commands in an appropriate place: the Dialer entry's Keyboard page, in the user's K95CUSTOM.INI file, or in the site-wide K95CUSTOM.INI file (see the README FILE for deatils).

Help! My Keyboard Has Gone Crazy!
The most likely explanation is that you accidently typed one of the following key combinations:

How Do I Defeat Idle Session Termination?
If you have a terminal session to another computer and you don't transmit any characters to it for a certain amount of time, your session might be terminated by the remote computer or by something between it and Kermit (but not by Kermit!) -- network address translators, firewalls, routers, etc.

To defeat this, you can tell Kermit to "do something" automatically every so often after you haven't transmitted anything on the connection for a given amount of time. The commands are:

SET TERMINAL IDLE-TIMEOUT number
Sets the limit on idle time in CONNECT mode to the given number of seconds. 0 (the default) means no limit.

SET TERMINAL IDLE-ACTION { EXIT, HANGUP, OUTPUT [ text ], RETURN }
Specifies the action to be taken when a CONNECT session is idle for the number of seconds given by SET TERMINAL IDLE-TIMEOUT. The default action is to RETURN to command mode. EXIT exits from Kermit; HANGUP hangs up the connection, and OUTPUT sends the given text to the host without leaving CONNECT mode; if no text is given a NUL (0) character is sent.

And for Telnet connections:

SET TERMINAL IDLE-ACTION { TELNET-NOP, TELNET-AYT }
Sends the indicated Telnet protocol message: No Operation (NOP) or "Are You There?" (AYT).

If you have a Telnet connection, try one of these; it is preferable to sending characters to the host session, since these Telnet messages are intercepted by the Telnet server and never reach your host session, yet they count as activity on the connection and should defeat any idle monitors between here and there.

Example 1: Suppose a certain Telnet connection has a five-minute idle limit; If you don't transmit anything to the host for five minutes (300 seconds) your session is closed. To defeat this, do:

set terminal idle-timeout 270        ; 4.5 minutes
set terminal idle-action telnet-ayt  ; Send Telnet "Are You There?"

Example 2: Suppose a certain dialup connection has a 10-minute idle limit; If you don't transmit anything to the host for ten minutes (600 seconds) your session is closed. Since it's not a network connection, you can't send network protocol messages; you have to send an actual character. Pick a character that is least likely to cause anything to happen on the remote end, such as NUL (ASCII 0) or Space (ASCII 32):

set terminal idle-timeout 570        ; 9.5 minutes
set terminal idle-action output      ; Send NUL

or:

set terminal idle-timeout 570        ; 9.5 minutes
set terminal idle-action output " "  ; Send Space

If you want these commands to be in effect for all sessions, put them in your K95CUSTOM.INI file. If you want them to be in effect for certain connections only, put them in the text box of the Login Settings page of the Dialer entry for each desired connection, or just type the commands at the K-95> prompt.

Why did my printer suddenly start printing?
The most likely explanation is that you accidently typed one of the following key combinations: Alt-P (print screen), Alt-O (start Copy-to-Printer), Alt-E (force printer page eject / formfeed), or the Print Screen key. Also, the host might have sent a "transparent print" escape sequence, or noise or binary data arrived at the terminal emulator that is the same as such a sequence. Use Alt-R to reset the terminal and cancel Copy-to-Printer or transparent printing.

How do I Assign Colors to Screen Attributes?
Terminals (depending on which kind) are capable of showing characters with all sorts of different attributes: bold, dim, blinking, reverse video, underlined, italic, protected, etc. Kermit 95 supports all these. and more.

Sometimes people want to have certain attributes shown as colors of their choice. K95 supports this for the following attributes: Blink, Protected, Reverse, and Underline. You need two commands for this. First disable normal treatment of the given display attribute with:

SET TERMINAL ATTRIBUTE name-of-attribute OFF
Tells K95 not to display the named attribute. Choices include: BLINK, PROTECTED, REVERSE, and UNDERLINE. Example: SET TERMINAL ATTRIBUTE UNDERLINE OFF.

Then specify the colors to be used to simulate the attribute:

SET TERMINAL COLOR attribute-type foreground background
Chooses the fore- and background colors for items of the named type, including REVERSE-VIDEO and UNDERLINED-TEXT. Example: SET TERMINAL COLOR UNDERLINE RED BLACK.

We don't support color substitution for all attributes (such as Bold, Dim, Italic, Invisible) since that gets into combinatorial problems: what happens when a character has multiple attributes, e.g. Bold, Blinking, Underlined, and Reverse? Plus that fact that color itself can be attribute. Similarly, assigning colors to a combination of attributes is not supported either.

Problems with Linux Terminal Emulation
The definition of the Linux "terminal" is constantly changing and must be updated in Kermit 95 every time it changes, all the while trying to ensure it still works with the previous definitions. It's a moving target. One item to be aware of: recent editions of the Linux Console terminfo/termcap command your terminal into a particular character set, which depends on your Linux locale. This happens silently and invisibly when you log in to Linux, and perhaps also at other times. You should also be aware that the Linux console does not support IBM PC code pages or Windows code pages.

Problems with SCO ANSI Terminal Emulation
This is a long story, to be fleshed out later. Very briefly: Old SCO operating systems, particularly SCO UNIX 3.2v4.x and OSR5 versions through 5.0.4, have an ANSI terminal type that is not compatible with everybody else's ANSI terminal type. In Kermit we call this SCOANSI. But older SCO operating systems do not recognize SCOANSI (or "scoansi") as a valid terminal type name. Therefore, when making Telnet, Rlogin, or SSH connections to SCO, you have to tell Kermit to lie about its terminal type:

set terminal type scoansi        ; What I am
set telnet terminal-type ansi    ; What I say I am

The same might (or might not) apply to some or all releases of UnixWare and Open Unix 8. It's necessary in any SCO operating system that uses SCO ANSI but does not have a terminal type called "scoansi".

UNFORTUNATELY there are still some complications:

  1. You can configure this setup in the Dialer for Telnet connections, on the Terminal page and the Telnet page. But for SSH (and possibly Rlogin) connections, the Telnet page is grayed out (this will be fixed in K95 2.1.4). In that case, put the SET TELNET TERMINAL-TYPE command in the Keyboard page script text box.

  2. Under certain as-yet unknown circumstances (but we suspect this happens when a Telnet, Rlogin, or SSH client announces its terminal emulation as ANSI or SCOANSI), the SCO operating system activates "mapchan", which interferes with both terminal emulation and file transfer by "mapping" certain characters to other characters. To see if this has happened to you, type "mapchan" at the shell prompt after logging in. If the response is a bunch of data (rather than the word "null"), you must turn off mapchan with the following shell command:

    mapchan -n
    

How Do I Access the Microsoft VTNT Telnet Server?
Use Kermit 95's built-in VTNT terminal type and then make a Telnet connection to the Windows machine where the Microsoft SFU Telnet server is running. Note that VTNT is a private and undocumented Microsoft protocol, which we had to reverse engineer. K95 1.1.20 supports VTNT as it existed at the time (1999), called SFU V1. After 1.1.20 was released, Microsoft changed VTNT for Windows 2000 and Windows XP; this is SFU V2. Thus if you are using K95 1.1.20 to make a VTNT connection to Windows 2000 or XP, it won't work right and you need to upgrade to the current version of K95.

VTNT is Unicode based. If you are using a Console version of K95, you must select a Unicode-based TrueType font such as Lucida Console.

Also see the section discussing Microsoft Windows Telnet Server and Kermit 95 in http://www.kermit-project.org/telnet.html.

How Do I Swap the Ctrl and Caps Lock keys?
Old timers and touch typists like the Ctrl key to be where Caps Lock is, and Esc to be above Tab and left of "1". Kermit 95 does not access the keyboard at level that would allow moving shift/modifier functions like Ctrl, Caps Lock, Shift, or Alt, but several methods are available external to K95:

Software Drivers
At least two are available: CTRL2CAP and REMAPKEY. The current versions of both of these seem to be for Windows NT (2000, XP) only but an earlier version of CTRL2CAP also worked for Windows 95/98/ME.

Replacement Keyboards
IBM-like keyboards from Unicomp, Avant, LinuXcare, and elsewhere that specialize in swapping Ctrl and Caps Lock, Esc and Grave/Tilde, and in some cases allowing for user customizations. The advantage of doing it in the keyboard itself rather than in the software means you don't have to change the software every time you upgrade or switch operating systems.

Digital Part number LK-461-A2 from Digital Parts Source 1-800-225-5385, $75.00 USD: a PC-compatible version of the DEC VT 220/320/420/520 keyboard that has 20 function keys and Ctrl left of the 'A'. (Digital Equipment Corporation has since been bought by Compaq Computer Corporation, which was then bought by Hewlett Packard; it is not known if they still sell this part, but a search of the Compaq website in early 2002 for "LK-461" turned up 60 references.)

How Do I Access IBM Mainframes?
Presently, Kermit 95 does not include IBM 3270 terminal emulation, nor a tn3270 client. The only way it can have IBM mainframe fullscreen sessions is through an intermediate 3270 protocol converter:

Most IBM mainframe operating systems support "linemode" sessions, which are similar to hardcopy sessions -- no screen formatting. Unless your IBM mainframe has linemode disabled, you should be able to establish a regular Telnet session to it. You can transfer files between K95 and Kermit-370 over any of these kinds of connections.

How Do I Disable Scrollback?
In Kermit 95 2.1.3 you can disable the GUI scroll bars, as well as the keyboard verbs that accomplish scrolling -- no matter what keys they are assigned to -- with the new NOSCROLL command or the new --noscroll command-line option. In earlier releases:

In the Console version, you can simply remap all the scrollback keys to execute the \Kignore verb:

set key \4385 \Kignore  ; Gray Page Up
set key \4386 \Kignore  ; Gray Page Down
set key \4388 \Kignore  ; Gray Home
set key \5409 \Kignore  ; Ctrl Gray Page Up
set key \5410 \Kignore  ; Ctrl Gray Page Down

You can do this in the GUI version too, but that doesn't remove the scrollbar. However, it's harder to scroll back by accident with the mouse than it is to hit the wrong key by mistake.

In both the Console and GUI version, you can limit the scrollback capacity with:

  set terminal scrollback number-of-lines  ; (Terminal screen)
  set command scrollback number-of-lines   ; (Command screen)

However, the minimum number of lines is 256.

How Do I Clear the Screen without Saving it in Scrollback?
Material is saved in scrollback whenever (a) a line scrolls off the top of the screen or (b) the whole screen is cleared. To clear the screen without having it saved in scrollback, have the host send an escape sequence like this:

  <ESC>[2;1H<ESC>[J<ESC>[1;1H<ESC>[K

(replace <ESC> with an actual Esc character). What it does:

  1. Puts cursor on the second screen line, left margin.
  2. Clears from cursor to end of screen.
  3. Puts cursor in home position.
  4. Clears from cursor to end of line.

These forms of clearing do not enter anything into the scrollback buffer.

Where is the technical documentation for xxx emulation?
The specifications for each terminal, such as VT320, HPTERM, AIXTERM, etc, might be several hundred pages long, and many of them are proprietary.

Purchase the manuals from the current marketer of the terminal. Manuals are still being sold for all Wyse and DEC VT terminals. Note that (a) DEC sold off its terminal products division years ago, and it has probably changed hands several times since then, and (b) DEC was sold to Compaq, and later Compaq was bought by Hewlett Packard. DEC and Wyse terminal manuals tend to be quite expensive.

For further information, visit Richard Shuford's Video Terminal Information site.

Why does scrolling or echoing seem slow?
They don't to most people. But on certain PCs, under certain circumstances, there might be a perceptible delay in scrolling or in echoing of the characters you type. This delay can have several components:

  1. Delays in the connection itself;
  2. How heavily loaded Windows is;
  3. Whether you have a client or a server edition of Windows;
  4. Windows scheduling of K95's several threads and its semaphore management;
  5. An extra (double) layer of overhead imposed by CONAGENT.EXE (Windows 95/98/ME only).
  6. Peculiarities of your video adapter and driver;
  7. Windows TCP/IP policies or heuristics;
  8. K95's own screen update algorithm.

Kermit 95 virtualizes the display. This is how it is capable of functioning as both a console and a GUI application not to mention supporting other operating systems such as OS/2. Any perceptible delays are usually due to thread allocation algorithms within the OS. If you are using K95 on a Windows Server edition, you should be aware that the OS is tuned to favor server, rather than client, applications, e.g. by allocating longer timeslices, and of course it runs an increased number of processes with "service" priority, which can result in some jumpiness between the threads.

Normally K95 refreshes the entire screen every 100 milliseconds, i.e. 10 times per second. This has proven to provide the best overall throughput, which is always a tradeoff between (a) responsiveness to keystrokes, and (b) speed of displaying large amounts of scrolling text. You can change the balance and the frequency with the command:

SET TERMINAL SCREEN-UPDATE { FAST, SMOOTH } [ milliseconds ]
Chooses the mechanism used for screen updating and the update frequency. Defaults are FAST scrolling with updates every 100 milliseconds.

A smaller interval might produce snappier echoing, but probably at the expense of scrolling speed. SMOOTH forces screen refresh with every incoming character, and so turns the balance to totally favor fast echoing.

In version 1.1.16, K95's echoing strategy was redesigned to give snappier echoing on modem connections, virtually eliminating any delay that can not be attributable to external causes. Echoing of a character from the local modem's command processor now takes less than 0.001 second, compared to about 0.110 second in 1.1.15.

Also, beginning in 1.1.16, screen updates are optimized. This results in noticeable speed improvements on most PCs, but paradoxically, slows down some others. To disable optimization, use:

  SET TERMINAL SCREEN-OPTIMIZE OFF

On TCP/IP connections (Telnet, SSH, Rlogin) you might be able to speed up echoing by disabling the "Nagle algorithm" in Windows TCP/IP, which saves up characters for a while before deciding to send them in case any more will be added to the queue, thus allowing more efficient transmission (more characters per TCP packet) but, obviously, slower response to keystrokes. To do this, give the command:

  SET TCP NODELAY OFF
This command must be given before the connection is made because it affects how the connection is opened.


PRINTING

[ Next ] [ Previous ] [ Top ]

Can Kermit 95 use Winprinters?
As noted in the documentation, Kermit 95 can print only on printers capable of printing either raw text and/or PostScript. Kermit does not support Graphical Device Contexts for Printer output, used by Winprinters. From Chapter 7 of the Kermit 95 online manual:

So-called "WinPrinters" are presently not supported by Kermit 95. These printers are marketed specifically for use with Microsoft Windows operating systems, and work only with Microsoft Windows. It might seem strange that Kermit 95 does not support them, since Kermit 95 is a native Windows 32-bit application, but "WinPrinters" require the print job to be formatted by the Win32 application. Transparent printing material, however, contains escape sequences or other non-textual data that can not be formatted as text.

Ironically, WinPrinters come with a 16-bit driver for use by DOS applications, but since K95 is a 32-bit application, it can't see this driver. Presently, the only way to print on a WinPrinter from Kermit 95 is to:

  set printer xxx

where xxx is a filename, and then to:

  run copy /b xxx prn

(i.e. run the DOS command to copy the print file in binary mode to the DOS printer). A series of macros can be defined to accomplish this, and can be assigned to hot keys to make printing to Windows printers relatively painless.


KERMIT FILE TRANSFER

[ Next ] [ Previous ] [ Top ]

Problems transferring files with the HP-48?
HP-48 Series calculators included an embedded Kermit protocol allowing programs and data to imported and exported to your PC. The procedures for using it are documented HERE.

Problems uploading files?
Kermit 95 as well as C-Kermit 7.0 and later default to high-performance file-transfer settings: long packets, sliding windows, "cautious" (rather than "paranoid") control-character prefixing, and -- on connections that allow it -- streaming. But, as we point out in the documentation, these settings are less likely to work everywhere than the normal conservative settings that are the default in most other Kermit programs, and which are the cause of the widely held misimpression that "Kermit is slow".

Sometimes file transfers -- especially uploads of binary files -- fail using these settings. Such failures can almost always be fixed by restoring full control-character prefixing:

  SET PREFIXING ALL

Or in the Dialer, edit the connection's File Transfer page. Change Performance to Custom, and change Control Char Prefixing to Never.

If that doesn't help, then give this command:

  CAUTIOUS

If you still have problems, give this command:

  ROBUST

(You can choose these on the Dialer's File Transfer page too).

If none of that helps, then consult Chapter 10 of Using C-Kermit, 2nd Edition: "Solving File Transfer Problems". And if that doesn't help, maybe K95's file-transfer partner has a defective Kermit implementation. Kermit 95 offers workarounds for most of the implementation bugs we know about in other products; click HERE and HERE for details.


THE BUILT-IN FTP CLIENT

[ Next ] [ Previous ] [ Top ]

What Are Active and Passive Mode?
FTP protocol uses two connections; one for commands and responses, another for data. When you give your FTP client a data transfer command such as GET or PUT, a second port is opened for the data. The server's command (control) port is normally 21 and its data port is normally 20. The client, however, can use any random port numbers greater than 1024 for its end of each connection:

Passive is Kermit's default mode since it tends to work better with firewalls. This is because the choice of port numbers is controlled inside the server-side firewall, and thus the server and the firewall can be configured by the site's network and system administrators to accommodate each other.

On secure FTP connections, commands and responses are encrypted and therefore cannot be understood by firewalls. Which brings us to the next question...

How Do I Use Secure FTP Through a Firewall?
If you have a firewall that filters the FTP command stream, it does not understand the encrypted messages and therefore is likely to terminate the control connection and/or block the data connection. Error messages will usually be uninformative, as in this example where the firewall closes the connection as soon as the client and server begin to encrypt their messages:

K-95> set ftp authtype ssl
K-95> set ftp debug on
K-95> ftp open xyzcorp.com
---> AUTH SSL
234 SSL enabled and waiting for negotiation
SSL accepted as authentication type
ftp: SSL/TLS connect command error:
error:00000000:lib(0):func(0):reason(0)
SSL authentication failed
K-95>

If you can't log in at all, you have to talk to the firewall administrator. If you can log in but can't transfer data (DIR, GET, PUT, etc), try switching modes (Active/Passive). FTP passive mode should work if the firewall is configured to allow connections to the ports that the FTP server chooses. If not, the problem can be solved only by your network/firewall administrator. Failing that, you'll have to make clear-text FTP connections (if the servers to which you need to make connections allow them), or else a different protocol (such as Kermit, which uses only one connection, not two).

What Are the Variations on SSL/TLS Security for FTP?
The following variations have come up during development of Secure FTP (FTPS):

  1. "SSL CONNECT", in which a connection is made to a special port (e.g. 990 instead of 21) and SSL negotiations happen automatically. Kermit does this when you include the /SSL (or /TLS) switch in the FTP OPEN command.

  2. "AUTH SSL", in which the connection is made to port 21 and then SSL negotiations are started when the client sends an AUTH SSL command.

  3. "AUTH TLS", in which the connection is made to port 21 and then TLS negotiations are started when the client sends an AUTH TLS command, and then a protection level is negotiated with the PROT command.

You have to use a method that is supported by the server. Method 3 is currently favored; the other two are "deprecated". Method 1 is not used by Kermit unless you ask for it. Methods 2 and 3 are negotiated automatically, with the first preference going to TLS; i.e. Kermit sends AUTH TLS first and then sends AUTH SSL only if AUTH TLS is refused. If necessary you can force Kermit to send AUTH SSL first (or send only AUTH SSL) with the SET FTP AUTHTYPE command.

For a table of FTPS servers that shows which of the three methods each uses, see:

http://www.ford-hutchinson.com/~fh-1-pfh/ftps-ext.html

How Do I Force a Clear-Text (Non-Secure) FTP Connection?
Secure FTP is rather new on the scene and not all combinations of client and server interoperate smoothly. When faulty negotions for SSL, TLS, or other security methods prevent Kermit from getting through to a server, you might have to force a particular kind of negotiation, or disable security negotiations altogether. For example:

SET FTP AUTHTYPE TLS  ; Forces AUTH TLS because AUTH SSL is "deprecated".
SET FTP AUTOAUTH OFF  ; Disables negotiation of an authentication method.

Why Can't I Make a Secure Connection to WS_FTP?
When Kermit 95 attempts to make a secure FTP connection ("set ftp auth ssl" or "set ftp auth tls") to the Ipswitch FTP server, WS_FTP:

http://www.ipswitch.com/Products/file-transfer.html

the connection fails. Debugging messages show:

ftp: SSL/TLS connect COMMAND error: error:1408F10B:SSL
routines:SSL3_GET_RECORD:wrong version number

The protocol for this is still in the discussion (Internet Draft) stage. The current draft is here:

http://www.ietf.org/internet-drafts/draft-murray-auth-ftp-ssl-11.txt

According to the proposed specification, when negotiating AUTH TLS, the TLSv1 protocol is required. WS_FTP, however, does not seem to support SSLv3 or TLSv1 but only SSLv2.

Experimentation shows that the WS_FTP implementation of AUTH SSL and AUTH TLS is incorrect, or at least undependable, in WS_FTP versions 3.0 to 3.1.4 to 4.0.0. In each case it was possible to establish connections using SSLv3. However, more often then not after the SSLv3 client Hello packet was sent to WS_FTP the server Hello packet was never returned. Eventually the connection timed out and the Kermit client reported an incorrect version number because the connection was dropped. There is nothing that can be done about this problem from within the Kermit client, which follows the specification.

Note that there is no way to tell the client to select between SSLv2, SSLv3, and TLSv1. These are (and must be) negotiated between client and server.

What Other Secure FTP Servers Are Available?
See Peter Runestig's public ftp server at ftp://ftp.runestig.com/ for source code to popular FTP servers patched to support AUTH TLS. Also see http://www.ford-hutchinson.com/~fh-1-pfh/ftps-ext.html for more FTPS implementations and a great deal more information on this topic.


ASSORTED HINTS AND TIPS

[ Next ] [ Previous ] [ Top ]

How Do I Capture the Output of a K95 Command?
Of course you can use the mouse to copy text from the command screen and paste it into any other application. This includes not just the visible screen; K95 also lets you scroll back while copying. Or you can scroll back first and copy downwards, etc.

Some Kermit commands have options to write their output to a file. For example, REMOTE commands allow Unix-like redirectors at the end, for example:

remote directory *.jpg > jpglist.txt

The DIRECTORY, GREP, and TYPE commands include /OUPUT: switches that tell them to write their output to the given file, e.g.:

directory /recursive /after:-5days /sort:date /output:recent.txt *.[ch]

K95 also lets you clear and save both command and terminal screens and scrollback into a file with the CLEAR and SAVE commands. To create a file showing the results of one or more commands, do this:

set command more-prompting off
clear command scrollback
(execute desired commands here)
save command scrollback filename

Using K95 with Host-Based E-Mail Programs
As described HERE, in these days of e-mail viruses, it is not a bad idea to avoid PC-based email programs and read all your email with a host-based plain-text e-mail client like Pine, Rmail, or MM. When you do this, you see MIME enclosures in their raw encoded format; for example base-64 encoding: many, many lines of:

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYF
BgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr/2wBDAQICAgICAgUDAwUKBwYHCgoKCgoK
CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgr/wAARCAQNBgADASIA
AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA

So how to view that snapshot that Aunt Hilda sent you? The labor-intensive method is to save the message in a separate file, edit out the base-64 encoded picture, save that to still another file, decode it into its original JPG, GIF, or BMP format into yet another file using the appropriate decoder, and then either put it on your own host-based website and (after setting the permissions appropriately) and view it from your PC browser, or download it to your PC and tell K95 to "run start hilda.jpg" or whatever.

Here's an easier method, but one that's not quite as safe:

  1. Make sure the message doesn't contain any enclosures besides .jpg, .gif or .bmp. Also make sure it's from someone you know and that it contains text that they wrote that makes sense to you, like "Here's a cute picture of little Otto at the beach". Just because it SAYS it's from somebody you know doesn't mean it really is! (Any mail that you receive these days, even from a friend or family member, is just as likely to have been generated automatically by a virus program.)

  2. Tell your mail program to copy the message to a file, xxx.eml. Substitute whatever you want for xxx, but you must use the ".eml" extension because that's the one Windows associates with its e-mail client.

  3. Exit from your e-mail program and download the .eml file to windows:

      kermit -s xxx.eml                (Substitute actual file name)
    

  4. Escape back to the Kermit prompt with Alt-x and type:

      run start xxx.eml                (Substitute actual file name)
    

This starts your Windows e-mail client (e.g. Outlook Express) with the mail message in it so you can see the picture(s). But again: be careful! If the message contained any enclosures other than pictures (such as Visual Basic scripts, Microsoft Word documents, HTML, ActiveX, etc), they could give your PC a virus, as explained in the Safe Computing document. In more recent versions of Windows, particularly those with security patches, the Microsoft mail client might refuse to show you any enclosures that are not pictures.

Accessing a Port-Blocked Mail Server with SSH Port Forwarding
Suppose you're on a business trip with your Windows laptop that you normally use to read your email using a Windows-based mail client. You find that you can't get at the mail server because you're outside the corporate firewall. But you can still make SSH connections through the firewall. Here's how you can use Kermit 95 to "tunnel" through your SSH connection to mail server. Before making your SSH connection, give a command such as:

  ssh add local-port 25 email.xyzcorp.com 25

in which email.xyzcorp.com should be replaced by the hostname of your own mail server, and 25 is the Simple Mail Transfer Protocol (SMTP, i.e. mail server) Internet port. This sets up TCP port 25 on your PC to forward to port 25 on the e-mail host through the SSH tunnel.

Now SSH to your login host. In your mail program, set the SMTP server to "localhost". Then as long as you keep the SSH connection open, you can use your mail program in the usual way.

The same trick can be used for any other TCP service that might be blocked from normal access.


INTEGRATING KERMIT 95 WITH OTHER APPLICATIONS

[ Next ] [ Previous ] [ Top ]

If you have a C or C++ application that already includes communications i/o and you just want to add Kermit file transfer protocol to it, you can use Embedded Kermit. If you need more than that, read on.

How do I embed Kermit in my application?
Many software makers ask us for Kermit software in special forms that can be embedded in their applications, to provide file transfer or other communications functions to their customers. But each software maker wants something different:

and on and on. And they desire this functionality to be packaged as a link library for this or that platform, a DLL, an OCX, a VBX, an Active X control, a Delphi component, a Netscape Plugin, a Java object, a Visual FoxPro object, a Windows Service, etc etc etc. The combinations of functionality and interface are many, and there is no way we can satisfy them without warehouses full of programmers, which nobody can afford to pay for.

Consequently we recommend that software makers who wish to embed Kermit functionality in their products (communications, scripting, file transfer, terminal emulation, character-set translation, etc) license and use the programs we already have available. See the next item for an example.

The "API" (Application Program Interface) is the command language. It is more fully expressive, precise, comprehensive, and portable than any other API that could be designed (look at all the commands in C-Kermit or MS-DOS Kermit or Kermit 95; each one is there for a reason). As new releases of the Kermit program come out, your product can be easily updated and will benefit from all the new features, fixes, and speedups automatically.

The recommended method of embedding Kermit in another application is via command-line invocation. The Kermit command line can contain a selection of simple commands, and it can also refer to more complex command files or scripts composed by your application. Kermit can be configured to create any kind of log you need, and it can return the status of its operations in various ways that can be used by your application.

When you license Kermit software for embedding in your application, we are happy to work with you to ensure it meets your needs. And if Kermit protocol transfers are important to you, then it should also be important to you to come to the source -- we developed the protocol, we continue to improve it, we believe in it, and we stand behind it.

Following this advice allows each party to concentrate on what they are good at, rather than unnecessarily duplicating efforts and "reinventing the wheel". You concentrate on your application; we'll do the communications. We support our software, you support yours, everybody is happy.

Kermit 95 version 2.1.3 (January 2003) includes new "lockdown" features of special interest to those who which to integrate Kermit 95 sessions with their own applications. For details, see the release notes.

How do I invoke Kermit 95 from Visual Basic?
Easy. First refer to Using C-Kermit, "Starting and Stopping C-Kermit". Note that you can invoke K95 with a command-line argument specifying the name of a file containing commands to execute; this filename must be the first argument after the program name. Suppose, for example, K95.EXE is in the PATH, and the command file is called UPDATE.KSC. Then the command line would be, simply:

  k95 update.ksc

The command file can be prefabricated, or it can be created dynamically by your application. If it is not in the current directory, of course you must specify the full path:

  k95 d:\scripts\update.ksc

If you want K95 to exit automatically when the script is complete, put EXIT commands in the script wherever you want to return control to your VB program.

To invoke K95 from VB, use:

  Shell (commandline, windowstyle)

where commandline is the command with which to invoke Kermit 95, such as "k95 update.ksc", and windowstyle is one of the following:

  0 - Hidden
  1 - Window has focus and is restored
  2 - Window is an icon with focus
  3 - Window is maximized with focus
  4 - Window is restored, current window keeps focus
  6 - Window is an icon, current window keeps focus

The Shell() function returns Kermit 95's task ID.

How do I Make Kermit 95 use an existing connection?
Invoke Kermit 95 with a command-line option that specifies the file handle for the open connection. The format depends on whether it is a serial or network connection:

For serial-port or modem connections
Use the command-line option "-l" with the numeric file handle of the open port or modem as an argument. Example:

"C:\Program Files\Kermit 95 2.1\k95g.exe" -l 664

For network (Winsock) connections
Use "-j" (lowercase) or "-J" (uppercase) with the numeric socket handle as an argument, perhaps by an underscore or dollar sign:

-j _number
The -j _number option is similar to -l one, except a network connection is assumed for the open handle. Kermit 95 is prepared to accept Telnet negotiations but does not initiate them.

-J _number
-J $number
When started this way, K95 treats the number as a TCP/IP socket handle. If the number is prefaced with an underscore, the socket is being used as a telnet client connection. If the number is prefaced by a U.S. currency (dollar) sign, the socket is being used as a telnet server connection.

Example:

"C:\Program Files\Kermit 95 2.1\k95g.exe" -j _636

If you want to invoke Kermit to perform only one action, such as receiving a file, put the desired action option after the -l or -j argument:

"C:\Program Files\Kermit 95 2.1\k95g.exe" -j _636 -r

In this case you might also want to include other command-line options to inhibit execution of the initialization file (-Y), loading of unneeded DLLs (-#), suppress unwanted messages (-Q), etc. See the Kermit 95 manual or type "help options" at the K-95> prompt for documentation of K95's command-line options.

For testing, you can use Kermit 95 to make a connection and then invoke a second copy of itself to use it. Example for serial-port connection:

K-95> set port com1
K-95> set speed 57600
K-95> run start \v(exedir)k95g.exe -l \v(ttyfd)

The \v(exedir) variable contains the full path of the directory containing the Kermit executable, complete with trailing directory separator. The \v(ttyfd) variable contains the numeric file handle of the open connection.

Example for Telnet connection:

K-95> set host xyzcorp.com
K-95> run start \v(exedir)k95g.exe -j _\v(ttyfd)

When the spawned copy of Kermit exits, it does NOT close connection; thus it should still be open and usable by the original process that spawned Kermit.

How do I invoke Kermit 95 from C++?
The following code snippet illustrates how to start K95.EXE (the console version) from a C++ application that wants to open the serial port itself. This might be done, for example, to keep a call open while invoking Kermit 95 several different times on the same connection. Of course many variations and refinements are possible. The Kermit 95 invocation is like this:

k95.exe -l 1234

where "1234" is the numeric file handle of the open serial port. Of course you can add any other desired command-line options; for example, the name of a script file to be executed:

k95.exe -l 1234 -C "take makethecall"

This tells Kermit the port is already open gives it the handle to use, and then has it execute the file called "makethecall", which contains Kermit commands (e.g. to make a modem call). This file should include the command SET EXIT HANGUP OFF, to prevent Kermit from hanging up when exiting. Here is the C++ code illustrating how to do this:

char buf[64];
SECURITY_ATTRIBUTES sec;
STARTUPINFO si;
PROCESS_INFORMATION StartKermitProcessInfo;

sec.nLength = sizeof(sec);                // Set security parameters
sec.lpSecurityDescriptor = NULL;
sec.bInheritHandle = TRUE;                // Let new process inherit handle

memset(&si, 0, sizeof(STARTUPINFO));      // Set desired startup info
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = ShowCmd;

HANDLE                                    // Open real serial port
hComm = CreateFile( "COM1",
                    GENERIC_READ|GENERIC_WRITE,
                    0,                    // exclusive access
                    &sec,                 // security attributes
                    OPEN_EXISTING,        // device must exist
                    FILE_FLAG_OVERLAPPED, // use overlapped i/o
                    NULL                  // hTemplate
                  ); 
if (hFile == INVALID_HANDLE_VALUE) {
    // handle error...
}

sprintf(buf,"k95.exe -l %ul",hComm);      // K95 invocation command line

if (CreateProcess(  NULL,                 // Start K95
                    buf,
                    NULL,
                    NULL,
                    TRUE,
                    CREATE_NEW_CONSOLE|CREATE_NEW_PROCESS_GROUP,    
                    NULL,
                    NULL,
                    &si,
                    &StartKermitProcessInfo
                 ) {
    // handle error...
} else {
    CloseHandle(StartKermitProcessInfo.hProcess);
    CloseHandle(StartKermitProcessInfo.hThread);
}

Replace "k95.exe" with "k95g.exe" if you prefer the GUI version, and include the full path if necessary.

For further information, see the Microsoft Windows API Reference.

How do I invoke Kermit 95 from Java?
You have to use the GUI version of Kermit 95 2.0 or later for this (K95G.EXE, not K95.EXE).

If you need to use the Console version (K95.EXE) for some reason, you have to work around problems with how javaw.exe starts Console applications, you must begin with a Console window, run java.exe in it, and then start K95.EXE from there.

If you want Kermit to use an existing network connection (one that was made from your Java application), the socket must be inherited from the parent process. Here's an example that starts K95G to have it receive a file (-r) on an open socket connection. In this case, it was found that the "$" prefix to the socket handle was required to prevent Windows from "aborting" the socket before control was returned to the Java process:

private void RunKermit_ReceiveFile(int socketHandle) {
    Process p = null;
    try {
        p = Runtime.getRuntime().exec(
                "C:\\Program Files\\Kermit 95 2.1\\k95g.exe -j $" +
                Integer.toString(socketHandle) +
                " -r"
            );
    } catch (IOException e) {
        e.printStackTrace();
    }
    try {
        p.waitFor();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}

Here's the code snippet from the same application that returns the socket handle by using java.lang.reflect to extract the protected socket file descriptor, so it can be passed to Kermit 95:

private int getSocketHandle(Socket clientSocket) throws Exception {

    // Get the SocketImpl impl object from the client socket
    Field socketImplField = getFieldFromClass("java.net.Socket","impl");
    socketImplField.setAccessible(true);			
    SocketImpl impl = (SocketImpl)socketImplField.get(clientSocket);
	
    // Get the FileDescriptor fd object from the impl object
    Field fileDescriptorField = getFieldFromClass("java.net.SocketImpl","fd");
    fileDescriptorField.setAccessible(true);	
    FileDescriptor fd = (FileDescriptor)fileDescriptorField.get(impl);
	
    // Get the int fd from the fd (FileDescriptor) object
    Field socketHandleField = getFieldFromClass("java.io.FileDescriptor","fd");
    socketHandleField.setAccessible(true);
    int socketHandle = socketHandleField.getInt(fd);
	
    return socketHandle;
}

private Field getFieldFromClass(String className, String fieldName)
  throws Exception {

    Class tempClass = Class.forName(className);
    Field[] classFields = tempClass.getDeclaredFields();

    for (int i = 0; i<fields.length; i++)
    {
        if (fields[i].getName().equals(fieldName))
          return fields[i];
    }
    return null;
}

Thanks to Marcus Mullins for the Java code samples.

[ Top ]


Kermit 95 FAQ / Columbia University / kermit@columbia.edu / 17 Oct 2003