Help Screen

Issue: November 1995
Section: Star dot star
Pages: 179-183


Contents

Equal rights for right mouse buttons
XT clock utilities
Converting text files
Elegant envelopes in WinWord
Filching filters from Freelance to WinWord
Two keys to privacy
'Nuking a file'
DOS debugger
Isolating that errant file
Choose the capable cable
Down for the count
The output's in the mail
Bureau of missing operating systems
Peace and quiet at last
Solving a sticky problem
Fast formats in DOS
Lock your Windows
DOS in Windows in the right place
Catching files in the Web


Equal rights for right mouse buttons

Try this in Windows 95: open Explorer or My Computer, right click on the A: drive, and select Copy Disk from the menu. Then click Start. Andy Rathbone (a computer book author) wasn't kidding when he said that Win95 would mean equal rights for right mouse buttons!!

Realise that Windows 95 is more intuitive, and you don't call an instruction and then say where to do it, but in a more normally human way, look at what you want to work on, then think what you want to do.

If I sound like a Microsoft fan, then so be it - it's a good product and I love it.

- Paull A Alekna

Editor's note: You do sound like a Windows 95 fan, Paull. The virtues of which you speak are those associated with object-oriented behaviour, a goal in the direction of which Windows 95 makes a small but crucial step. When Andy Rathbone talked about equal rights he may also have been referring to the degree to which you can configure the mouse in Windows 95. When you launch the Control Panel Mouse Properties dialogue you can click a radio button to switch your mouse between right- and left-handed operation.

XT clock utilities

A few issues back in PC World you were asking for a utility to read and write the clock from and to an XT; I'm sending the utilities used in my Laser 8088 XT (circa 1988!). For example, GetClock would be a command in autoexec.bat to obtain the current clock. I hate the way technology is discarded in this fast world. It's wasteful.

- Lionel Edwards

Editor's note: Thanks Lionel. It certainly helps us to avoid discarding chronologically-challenged technology when people like you help by sharing support and software. I'll make this available to other readers.

Converting text files

I read your response to Eric Jamieson regarding converting text files imported from Galaxy to MS-Works in the September edition and could not believe my eyes. I had assumed that the knowledge of how to clean up imported text files had been handed down from generation to generation since the dawn of time, or at least since the late 1980s. Obviously this precious information has got lost.

Before describing the method, I must correct one specific point in your response. Despite what you say, it is in fact perfectly possible to do search and replace in Works for the hard carriage return character (^p). In fact, Mr Jamieson himself says he tried this. The problem with his approach of finding and deleting these is that, as he says, all the text runs together, including the paragraphs.

The answer is simple. First, start by searching not for each ^p, but for double combinations: ^p^p. These mark the ends of paragraphs. Using Works' Replace function, find and replace these with a combination of characters that are unlikely to appear normally in the document, say a double hash (##).

Then search for the remaining single ^p characters. These will mark the end of lines. Replace these with a single space.

There may also be a left margin created with spaces at the beginning of lines. If the imported document appears with a consistent number of spaces at the beginning of each line, you could search for ^p followed by this number of spaces, less one, and replace with nothing.

The document will now wrap properly at margins. Now simply reverse the first search. That is, replace the double hash (##) with the double carriage return (^p^p). This will restore the paragraph structure. Finally, search through the document a few times, replacing double spaces with singles, as there will invariably be the odd double space floating around.

The only time this approach causes problems is with columns in tables. Even if these were tabbed rather that spaced apart in the original, the conversion to a text file will turn the tabs into spaces, and of course the structure will be altered in the conversion process. If your document does contain a table, the simplest option may be to convert the remainder of the file automatically then adjust the table manually.

- Alex Gooding

Editor's note: Thanks Alex. It's possible to create a macro to do this if you're working in a word processor that supports macros.

Elegant envelopes in WinWord

If you print envelopes in Word for Windows 6.x, you may want to use a different font for envelopes than for documents. Here's how to change the default fonts for your envelopes' outgoing and return addresses, a technique not documented in WinWord manuals.

First, open a new document based on the template normal.dot. Then select Format-Style. When the Style dialogue box appears, go to the List drop-down menu in the lower-left corner and select All Styles.

To change the font for your outgoing address, select Envelope Address from the Styles list, then click the Modify button on the right side of the dialogue box. This brings up the Modify Style dialogue box. Check the Add to Template option in the lower-left corner. Click the Format button and select Font from the resulting menu. You can then select the font, font style and size in the familiar Font dialogue box. Click OK in both the Font and Modify Style dialogue boxes.

To alter the look of your return address, simply repeat the process, selecting the style Envelope Return.

From then on, whenever you print an envelope from a document based on normal.dot, or one based on another template that doesn't prescribe its own envelope formatting, you'll get the fonts you've picked.

- Frank Schrader

Editor's note: Envelopes are defined through standard paragraph styles. Thus, you can easily change them for one or for all documents (that Add to Template option does the trick).

Filching filters from Freelance to WinWord

Unable to import a graphics file into a Windows application? The filter you need may already be on your hard disk - if you know where to find it and how to use it.

I once needed to import a Targa (.tga) image into Word 2.0 for Windows but was disappointed to learn that the format wasn't supported. Luckily, I had Lotus Freelance Graphics 2.0 for Windows on the same computer. I had noticed that when I imported a file into either application, a message told me the filter was from Imagemark Software Labs. And some of the filters that came with the two products had identical names, dates and file sizes. Hoping the filters might be interchangeable, I searched the Freelance file flw.ini for filter names and added them to the WinWord section of win.ini. When I was done, I'd added more than a dozen "new" formats to WinWord - and they all worked perfectly.

- Michael Verive

Editor's note:

In this case, sauce for the goose really is sauce for the gander, and there may be other applications with which you can do this. The switch works in WinWord 6.x as well, although there you may not have as much of a need since that version has more graphics filters.

The trick is to create the proper lines in the target application's .ini file. Figure 1 shows an example of a line from flw.ini (called flw2.ini in some versions of Freelance) and its translation for the WinWord section of win.ini. You may also have to copy isgd19.dll from c:\windows\lotusapp\filters to c:\windows\system so that WinWord can find it. (The file must remain in its original location or Freelance can't use it.)

Knowing the naming conventions that Lotus uses for graphics filters will make it easier to find the filter files you need. The first letter is i for import filters or e for export filters; the second is m for graphics metafiles or r for raster (bitmapped) images. The next three characters are the file type's extension, and the last character is always the digit 9. The filter file's extension is always .flt. Hence, the file for importing .tga files is irtga9.flt.

flw2.ini:

Import Files

TGA=Targa Bitmap (TGA),irtga9,TGA,RASTER

win.ini:

MS Graphic Import Filters

Targa Bitmap(.TGA)=C:\LOTUSAPP\FILTERS\IRTGA9.FLT,TGA

Two keys to privacy

It's a little-known fact that if you use DOS's Doskey utility - a TSR that keeps a history of what you type at the DOS prompt - anyone, including your boss, can walk up to the keyboard and instantly produce a list of your commands. All they need do is press <F7>.

Luckily, you can thwart snoops by pressing <Alt>+<F7> before walking away from your computer. This deletes Doskey's list of commands. Once you've done this, you can't use the cursor keys to recall old commands, but at least your boss won't be able to tell how many games you've been playing.

- Shannon Little

Editor's note: Like Unix's history command (from which it is derived), Doskey's command-recall facility can be either a boon or a potential breach of privacy. It pays to clear the buffer if you're worried that someone might want to track your activities.

Another powerful but seldom-used Doskey function key is <F8>, which searches the list of stored commands for one that begins with given characters. To use it, type a command's first few characters and press <F8>. If you press <F8> repeatedly, other commands beginning with those characters, if present in the buffer, will appear.

'Nuking a file'

DOS's Del command won't delete a file with either the read-only, hidden or system attribute turned on, such as an old Windows temporary swapfile or a checksum file created by a virus scanner. Many people get around this protective feature by turning off the attributes with the attrib command before deleting. But a faster and easier way is to use DOS 6's Deltree command. Simply type deltree filename.ext; after a confirmation, the file is erased. (If you use deltree /y filename.ext, you won't even be asked for confirmation.)

- Oren Pinsky

Editor's note: This is a powerful technique that "nukes" files in a hurry, but use it with caution. The greatest danger: if you include a wildcard (the characters * or ?) in a deltree command file name parameter, and the file specification matches the name of a directory as well as an individual file, both will be deleted. But if you're aware of this caveat, you'll find deltree an extremely fast and powerful way of removing any file from your disk.

DOS debugger

Want to step through a batch file to see which commands are causing problems? DOS 6's command.com can single-step batch files - sort of a primitive, built-in debugger. Just use the command command /y /c batch (where batch is the name of the file you're testing). DOS will prompt you before executing each line, asking if that command should be run or skipped. You can then survey each line's results.

If at some point you want DOS to simply run the rest of the batch file straight through, just press <Esc>.

You can bring up this debugger without remembering the syntax by creating a batch file called debat.bat with the single line @command /y /c %1. So long as this file is in a directory in your autoexec.bat's path statement, the command debat batch runs batch in debug mode.

- Frank Bonn

Isolating that errant file

When naming a file, you may accidentally press an extra key, say the <Space> bar. Deleting this file may be difficult (because you can't see the extra character or don't know the key you hit) unless you enter the DOS command del /p *.*. When DOS prompts you to confirm each file's deletion, answer no to all the prompts except for the file that you want to delete.

- Bill Austin

Choose the capable cable

After connecting our two printers - a Canon BJC-600 and a Canon BJC-4000 - to two different computers, we had trouble printing from Windows. We could print from DOS applications like WordPerfect, but in Windows we received a message saying the printer was turned off or not on-line.

We discovered that the problem was caused by an inadequate printer cable. The PC's BIOS doesn't use all the signals on the printer port, but Windows does. Therefore, a cable without all the correct wires may work fine in DOS, but prevent you from printing in Windows. When we changed the cable, the printer worked correctly.

- Lance Jarrett

Editor's note: Windows' printing functions bypass your PC's BIOS and go directly to the hardware, so incompatibilities can arise. If you don't have another printer cable handy, you can sometimes circumvent this problem by opening Control Panel, double-clicking the Printers icon, clicking the Connect button, and choosing the printer port LPT1.DOS. (In Windows 3.0, select LPT1.OS2.) This forces Windows to use DOS and the BIOS instead of bypassing them. But if you want the best performance, or plan to move to a 32-bit operating system such as OS/2, it's best to replace the cable and make the printer connection fully functional.

Also, if you have a bidirectional parallel port and a printer that supports a bidirectional parallel interface, make sure your cable supports these as well.

Down for the count

Many Star-Dot-Star columns have featured fancy tricks using the for command, but none have shown a way to make for provide successive integers to the command it's repeating. Here's a way that's downright simple: just include a list of numbers in the for statement itself. For example, the command for %%i in (1 2 3 4 5) do something (where something is a DOS command you choose) will repeat the something command five times, each time passing it a new number for the variable %%i. Since a DOS command can be 126 characters long, you can enumerate plenty of numbers before running out of space.

- Ed Spooner

Editor's note: We have often discussed some complicated ways to iterate and parse strings using the for command, but for many applications nothing can beat the simplicity of this technique. To get an idea of its power, create this sample batch file:

@echo off

for %%i in (1 2 3 4 5) do echo %%i

When you run the batch file, you get the five numbers lined up in one column. Try replacing the numbers with letters, or with the names Groucho Harpo Chico Zeppo Gummo.

For a more useful example, I've created a pair of batch files - print5.bat and onecopy.bat (see Figure 2) - that work together to print a single file five times, showing the number of copies printed each time. To use them, type print5 filename, where filename is the name of the file you want printed. The two batch files need to be in either the current directory or a directory in your autoexec.bat's path statement.

print5.bat

@echo off
if "%1"=="" goto NoParam
if not exist %1 goto NoFile
@for %%i in (1 2 3 4 5) do call onecopy.bat %%i %1
goto end

:NoParam
echo You need to give me a file name
goto End

:NoFile
echo File does not exist

:End

onecopy.bat

@echo Printing copy %1 of 5....
@copy /b %2 prn

The output's in the mail

Have you ever needed to e-mail fancy documents that contain special fonts or figures, and faxing just wouldn't do? Simply make your application print to a file instead of to your printer, then attach the resulting file to an e-mail message. In the text portion of your message, tell the recipient to save your file to disk, then print it with the command copy /b filename.prn prn, where filename.prn is the name of your file. (The /b parameter ensures that binary codes in the file are transferred to the printer without any filtering.) The result comes out on the recipient's printer as if you had printed it yourself.

- Paul Kimmel

Editor's note: This trick is ideal when you don't want to use fax, mail, express services, or couriers to send formatted information, and the recipient lacks the program you used to create the document. The one limitation is that you must "print" using a driver the recipient's printer can understand. If he or she has a laser printer, the HP LaserJet Series II driver is a good bet.

To prepare to print a file within Windows, launch Control Panel, double-click the Printers icon, click Add, and add the appropriate printer (you may be prompted for your original Windows floppy). Once the printer appears in your list, click the Connect button, and for Ports select FILE. When you print to your new "printer", Windows will ask you to name the file.

Bureau of missing operating systems

If you boot your machine and get the message "Operating system missing", don't panic! While this message sometimes signals a malfunctioning or corrupted hard disk, it often crops up when the contents of your machine's CMOS RAM have been destroyed. Before you do anything else, try restoring your machine's CMOS settings.

- Patrick Cernyar

Editor's note: A CMOS RAM is a battery-backed memory store for your computer's time, date and system information. A corrupted CMOS can prevent your system from reading the bootstrap information from the hard drive, leading it to conclude that the operating system is missing.

As Cernyar suggests, the first thing to do is to check your CMOS settings, in particular, the ones that govern the hard drive. Use your BIOS's automatic sensing facility to find the correct disk settings, or, if the BIOS doesn't have this feature, program them as directed in the disk's instruction manual or on the drive label. Only if this doesn't work should you check the cables - or worry that your drive might be malfunctioning or infected by a virus.

Peace and quiet at last

The two usual methods of suppressing output from batch files - issuing the command @echo off and redirecting program output to nul - don't always work. If a program shows an error message by sending output to the screen, for example, it will appear even if you use both of the above techniques.

A better solution is to place the command @ctty nul at the beginning of the batch file and @ctty con at the end. These commands suppress output so well that even echo statements don't echo, assuring you of no output when the batch file runs.

- Craig Tomchuk

Editor's note:

The ctty command, originally used to allow a terminal attached to a serial port to become the system console, is an effective way to suppress output from DOS. As a bonus, it suppresses keyboard input. DOS won't accept keystrokes from the keyboard between the @ctty nul and @ctty con commands. (Note that the @ signs in these commands keep the commands themselves from being echoed.) This makes the ctty command a useful security measure; it prevents users from halting a batch file once it has started.

It's important to note, however, that programs that bypass DOS and write directly to the screen, or that poll the keyboard directly via the BIOS, will display output and accept input even when @ctty nul is in effect. Also, be warned that if your batch file terminates midway for any reason (or invokes another batch file and never returns), the @ctty con command, which restores control to the keyboard, might not be executed, leaving you unable to enter DOS commands.

Solving a sticky problem

Ever wish floppy disk labels weren't so difficult to remove? Here's a solution: stick a label onto your clothing, peel it off and then put it on your floppy. When you want to change it, it will peel off without tearing.

- L Fuller

Fast formats in DOS

Need a floppy formatted fast? In DOS, you can pop a used disk in your drive and use the command format a: /q /u for an instant format. The catch is that you won't be able to unformat the floppy if you discover you need some of the old files.

- Suzy Lewis

Lock your Windows

There have been several letters recently about security in Windows, including a letter in your September issue from Bill Bradley of Bellevue Hill in Sydney. There are ways of locking Windows using win.ini or system.ini, but these are cumbersome. I use a freeware program called SecureGroup which I obtained from the Internet. With it you can lock any aspect of Windows. It is easily configured from an icon and I can't fault it. I use it on my office network. I will upload a copy to anyone that wants it or you can e-mail the author, Andreas Furrer, at s_furrer@ira.uka.de. I'm sure it could be found on any large Windows database.

- Stewart Bedford

Editor's note: I found a copy of SecureGroup on the Internet at http://coyote.csusm.edu/cwis/winworld/security.html. Search on-line services for a file called secgp115.zip. I was able to put password protection on selected Program Manager groups and disable the Program Manager File menu and Window exit. It's a very handy utility. Thanks Stewart.

DOS in Windows in the right place

If you're in the Windows File Manager and you want to run a DOS session in your current directory, don't go to Program Manager's MS-DOS Prompt. Instead, select File-Run, and at the resulting prompt, type command and press <Enter>.

- Lincoln Spector

Catching files in the Web

Most people know how to use their World Wide Web browsers to access Web pages - HTML documents designed for viewing on the Web. But not everyone knows that you can also use a browser to retrieve files from an Internet site that's not on the Web. Instead of an address that begins with http, you specify an address with the prefix ftp, which stands for File Transfer Protocol.

To do this, tell your Web browser to go to the Uniform Resource Locator (URL) ftp://hostname; it will show you a top-level directory listing. You can then browse the directory tree, picking and retrieving the files you want. There's no need to log in as anonymous or enter your e-mail address as with other FTP programs; the browser handles it all automatically so you can get on with the business of downloading files.

- Mark Hendam

Editor's note: This trick works because each generation of Internet tools is compatible with the ones that came before. Web browsers can browse resources available via Gopher, a distributed system of menus that was the predecessor of the Web. (Like the Web, Gopher lets you jump instantly from machine to machine in search of information, but it doesn't have the Web's hypertext or graphics capabilities.) Gopher, in turn, has always supported easy access to libraries of files available via FTP and to hosts that are accessible via Telnet (that is, ones that interact with users as if they were at a terminal connected directly to that host). A complete Web browser supports all four types of access.

The code before the colon at the URL's beginning (for example, http, gopher or ftp) tells the browser which access method to use. The Web is slow, so if all you want is to download files, go right to FTP, even if the host has Web capabilities.

- Neale Morison and Brett Glass


These Web pages are produced by Australian PC World © 1996 IDG Communications