-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PCM Online December 1994 SOLUTION Contents: [] Printing to "Disk" in Windows [] Preparing for the Worst With an Emergency Disk [] What's on This Disk? [] Here's YAFF (Yet Another File Finder) Entire contents copyright 1994 by Falsoft, Inc. PCM -- The Premier Personal Computer Magazine -- is intended for the private use and pleasure of its subscribers, and reproduction by any means is prohibited. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Printing to "Disk" in Windows ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Do you ever create Windows documents you can't print? Say the printer is at work, but at work you don't have a copy of the program that created the file, so you can't print? Or you want to print a desktop- publishing file on your friend's fancy new printer -- but your friend doesn't have your fancy software? Or the fonts you're using to create the file aren't supported on the printer you eventually need to print to? There's a solution to all these scenarios: printing to disk. Windows offers a way for you to "print" everything that would normally go to the printer to a disk file -- all the fonts and graphic images are embedded within that file for the target printer. To print to disk, the first step is to install the driver for the target printer if it isn't already on the system. Go to Control Panel (in the Main group), click on the Printers button, click the Add >> button and select the printer to "install." (Dig out those Windows installation disks.) Then click the Connect button and select FILE: as your output. Now when you try to print with the target printer selected, you'll be asked for a filename. Supply a filename, then copy that file to a floppy disk, which you'll take to the computer connected to the target printer. At that computer's DOS prompt, type COPY filename PRN /b and press ENTER. The /b is for binary and ensures that all pages get copied. (Without the /b, the print procedure could abort at the first control character it encounters.) You will need a "dedicated" DOS prompt. If you're shelling to DOS from Windows, wait for the system to return your prompt to you after the COPY command before task-switching off to another program -- otherwise you could get a very jumbled printout. -=------------- -=*=- -=*=- -=*=- -------------=- Preparing for the Worst With an Emergency Disk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It pays to be prepared. So keep a smoke detector in your house, never be without a handkerchief, and always, always have an emergency boot disk on hand. An emergency disk is a floppy that's been formatted with system files, so it's bootable. This disk will let you into your system when your hard disk won't. Just put the disk in Drive A and restart the computer. But in addition to just the basic operating system, you should also copy important utilities to your emergency disk, things like the Restore portion of your backup utility, PKUNZip, an anti-virus utility (we recommend McAfee's SCAN and CLEAN shareware anti-virus programs) and even some of the programs from The Norton Utilities -- it'll save you the trouble of tracking down their installation disks. It would be especially helpful to copy Norton's Disk Doctor utility to your emergency disk, along with all the small utilities you incorporate into your daily computing regimen. If you routinely use a directory enhancer (like HotDIR) or a small DOS shell program for managing files, don't forget to include it -- then your boot disk will have all the comforts of home. Update your emergency boot disk often, and don't let old boot disks linger -- especially if they were formatted using a version of DOS that's older than the one currently installed on your hard drive. Imagine booting under a DOS 3.1 emergency disk and not being able to reach any of your huge, non-partitioned, DOS 6.0 drive! >>[ Emergency Boot Disk Batch File ]<< You can easily make your own emergency boot disk by formatting a floppy (type FORMAT A: /S ) and copying files to it. But, if you like, we can help you get the important files to the floppy with the following batch file. Type CD C:\DOS to change to your DOS directory and then type the following to create the batch file called MAKEBOOT.BAT. COPY CON MAKEBOOT.BAT FORMAT A: /S COPY C:\AUTOEXEC.BAT A:\AUTOEXEC.BAK COPY C:\CONFIG.SYS A:\CONFIG.BAK COPY C:\DOS\SYS.COM A: COPY C:\DOS\RESTORE.EXE A: COPY C:\DOS\TREE.COM A: COPY C:\DOS\FORMAT.COM A: COPY C:\DOS\FDISK.EXE A: -Z To run the batch file, insert a blank floppy disk into your Drive A (remember, the system can boot only from Drive A, not from Drive B), type MAKEBOOT, and press ENTER. Since MAKEBOOT.BAT resides in your DOS directory -- which we assume is pointed to in your PATH statement -- you can type MAKEBOOT at any DOS prompt to automatically make an emergency boot disk: this batch file will work with any version of MS-DOS. Note that any other utilities you want to include on your boot disk you must copy manually -- or add COPY commands for them to your MAKEBOOT.BAT file. Also note that we copied the AUTOEXEC.BAT and CONFIG.SYS files to the floppy but renamed them with a .BAK extension. The reason we did this is that we wanted them there for reference purposes, but we didn't want the computer to act on them at bootup -- after all, the configuration files may be part of the problem. It's best to run from as "bare" a system as possible when troubleshooting, which means staying away from the AUTOEXEC.BAT and CONFIG.SYS files -- which may be brimming over with strange commands. If you're used to custom prompts, however, you might want to create a simple, floppy-oriented AUTOEXEC.BAT file, like this one, which you can create at the DOS prompt by typing COPY CON A:\AUTOEXEC.BAT PROMPT $P$G PATH A:\ CTRL-Z With this AUTOEXEC.BAT file, you'll get a more useful DOS prompt and fewer occurrences of the "Bad command or file name" message. If you want to copy a lot of utilities to the boot disk, be sure to use the highest-density floppy disk your Drive A allows. The very last step in preparing an emergency boot disk, after you've run MAKEBOOT.BAT or copied all the files, is to write-protect it. When you write-protect a disk, you make it impossible to erase files from it accidentally. To write-protect a 5-1/4-inch floppy, put a piece of non- transparent tape over the notch in the upper-right side. To write- protect a 3-1/2-inch floppy, flip the tab on the back of the disk into the "up" position; when the disk is write-protected, you'll be able to see through the hole. -=------------- -=*=- -=*=- -=*=- -------------=- What's on This Disk? ~~~~~~~~~~~~~~~~~~~~ In an out-of-the-way corner at work sits a disk box containing a stack of floppies. No one knows what they hold or who left them there. Now, your mother always told you to stay away from strange software, and not to pop any old disk into your floppy drive. But sometimes you just have to live dangerously. Whether you come upon them in a dusty storeroom or are given them by a friend, there will be times when you are faced with floppy disks of unknown origin. Ah, the mystery! Could they hold your company's missing accounting records for 1989 -- or merely somebody's unwanted backup files? There's only one way to find out, friend: pop that disk in your floppy drive and type the DIR command. >>[ Think of Stormin' Norman -- Or Napoleon ]<< What does the DIR command show you? Lots of files -- which use standard extensions in their filenames to identify themselves. How do you know which files are active and actually do something when you type their names, and which are only supporting data files? Well, bull your way in like a military general and start typing files whose names in .COM, .BAT and .EXE. Files with those extensions (compiled, batch and executable files) should lead you to an actual running program -- and your mystery is solved. As an aside, we've decided to coin a new term for a military bigwig: combat executive. Get it? COM BAT EXEcutive. So when you're faced with a listing of mystery files like enemy soldiers and wonder which ones to target, think to yourself, "Now what would Napoleon, that crafty COM BAT EXEcutive, do?" >>[ What if .COM, .BAT and .EXE Don't Work? ]<< Somebody's trying to make your life difficult. No, really. A disk could be full of installation data files with the active program on another disk. Or it could be that some sort of setup procedure is required. But with just a stack of disks and no manual in sight, what do you do? Look for instructions supplied in a file. After typing DIR, examine any file resembling README or MANUAL.DOC. README is a filename typically given to a file that explains last-minute program changes and clarifies installation procedures. MANUAL.DOC is a filename common to shareware programs -- which "print" the manual inexpensively on disk. If README and MANUAL.DOC files aren't present, look at files that end in .TXT or .DOC extensions. Newer shareware files also sport a FILE_ID.DIZ file that succinctly tells you exactly what the program is all about. Use your word processor to read README, MANUAL, .DIZ, .DOC and .TXT files -- they'll be in universal ASCII format. Or you can use DOS's built-in TYPE command, like this: TYPE SAMPLE.DOC | MORE [ENTER] >>[ Those Strange .ZIP, .LZH and .ARC Files ]<< Sometimes you'll find disks that contain files ending in strange extensions like .ZIP, .LZH and .ARC. Those three extensions denote compressed files that were created with the PKZip, LHA and PKPak utilities, respectively. A compressed file is like a suitcase containing other files; you'll need to decompress the file (open the suitcase) to use the files inside or even be able to see them with the DIR command. And to accomplish that, you'll need the services of the PKUNZip, LHA and PKUNPak utilities, respectively. Because you never know how much space a group of decompressed files will require, it's best to decompress them in a temporary directory on your hard drive. (A 200K file called PICTURES.LZH, for example, may contain more than a megabyte of TIFF image files.) To examine a compressed file, first you must acquire the appropriate decompression utility (PKUNZip for .ZIP files, LHA for .LZH files and PKUNPak for .ARC files). You can find any of them on a BBS or through a shareware vendor. OK, so you've found your decompression utility, and now you want to investigate that intriguing LOOKATME.LZH file on the floppy disk in your Drive A. Try these commands at the DOS prompt to set up a temporary directory on your hard drive, copy the .LZH file, decompress it, and run the new program: C: MD \LOOKATME CD \LOOKATME COPY A:\LOOKATME.LZH LHA X LOOKATME.LZH LOOKATME.EXE >>[ General Failures Can Lead to Success ]<< What does it mean when you run a DIR command on a disk and get this message? General failure reading drive B Abort, Retry, Fail? It could mean one of three things: 1. The disk is unformatted. 2. The disk has a serious flaw. 3. The disk was formatted for another computer system. For instances 1 and 2, reformat the floppy and add it to your disk box. For instance Number 3, we got that error reading a disk formatted for Tandy's Color Computer. If you get the error on a 5-1/4-inch floppy disk, chances are it could be a disk formatted for the Commodore 64, a TI-99, an old Atari computer -- or the CoCo. If you get it on a 3-1/2- inch disk, especially if it's a high-density disk (there will be two holes in the case), chances are it's a Macintosh disk. If you're really curious and can't rest until you know what's on that floppy, track down some owners of "foreign" systems, run the DIR command (or its equivalent) and see if you've got a match. If it's not your style to hobnob with "foreigners" at computer conventions, you might look into specialty file-viewing utilities. For instance, you can read and write Macintosh files on 1.44MB floppy disks -- on your MS-DOS computer -- using a $199 program called Mac-In-DOS. Note that you won't be able to run Macintosh programs, but you will be able to look at the files, one of which will probably be some readable information about what the program is. [For info on Mac-In-DOS, contact Pacific Micro, 201 San Antonio, Suite C250, Mountain View, CA 94040, (415) 948-6200; $199.] A viewer for Color Computer disks is also available. You can also find specialty file-viewing programs on bulletin board systems. >>[ Key for File Extensions ]<< We alluded to "standard" extensions above, and with good reason. Years of experience have taught most users that certain extensions make good sense in certain places, and powerhouse programs often use easily identifiable extensions so you'll know which files go with which program. Below are several of the more-common extensions used in the MS- DOS industry. Executable Files: .BAT -- batch .COM -- compiled .EXE -- executable ASCII Text Files: .DOC -- document .TXT -- text Backup Files: .BAK -- backup Configuration and Initialization Files: .DAT -- data .INI -- initialization .SYS -- system Font Files: .PFB, .PFM -- Adobe .FOT, .TTF -- TrueType Windows Files: .CFG -- configuration .CLP -- Clipboard .DRV -- driver .DLL -- dynamic link library .FON -- system font .ICO -- icon .HLP -- help .INI -- initialization .OBJ -- object Graphics files: Bitmap: view them with an image-display utility like CSHOW or Windows' Paintbrush .BMP -- Windows' bitmap .GIF -- CompuServe's graphic interchange .IMG -- GEM format .JPG -- JPEG, compressed .PCL -- HP printer command language .PCX -- ZSoft .RLE -- run-length encoding .TGA -- Targa .TIF -- tagged image file format .WPG -- WordPerfect Vector: view them with a drawing program like CorelDRAW or Designer .CDR -- CorelDRAW .CGM -- Computer Graphics Metafile .EPS -- encapsulated PostScript .WMF -- Windows Metafile Sound Files: .MID -- MIDI music -- listen to it using Windows' Media Player .VOC -- Sound Blaster digitized wave file .WAV -- Windows' digitized wave file -- listen to it using Windows' Media Player Compressed Files: .ARC -- PKArc or PKPak .ARJ -- ARJ .LZH -- LHA .ZIP -- PKZip .ZOO -- Zoo Popular Application Extensions: .DBF -- dBASE .DOC -- Word for Windows document .DOT -- Word for Windows document template .WK1 -- Lotus 1-2-3 .WKS -- Lotus 1-2-3 .WP5 -- WordPerfect document file .WRI -- Windows Write document file .XLS -- Microsoft Excel file .NDX -- dBASE index .MDX -- dBASE IV multi-index -=------------- -=*=- -=*=- -=*=- -------------=- Here's YAFF (Yet Another File Finder) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If there is a million ways to do something, there's probably a million and one. Why should finding files be any different? Here's YAFF -- Yet Another File Finder. Just enter ATTRIB filespec /S where filespec is the filename you want to find. This approach is far more versatile than the CHKDSK /V | FIND approach in that it fully supports wildcards and searches subdirectories without pause. Better yet, you can limit your search to just a branch of the directory tree. For example, to find all files that end with .DOC and are stored somewhere beneath your WINWORD directory, you might enter ATTRIB C:\WINWORD\*.DOC /S The output of this command line shows all pertinent subdirectories where the files are located. The only drawback is that it also prints the file attributes (a small price to pay, indeed). Because DOSKEY supports "command-line" parameters, it is well-suited for this file-finding approach. A macro like DOSKEY FFIND=ATTRIB \$1 /S works great, allowing you to search from the root of the current drive, or any complete pathlist from the root. To call the macro, you would enter something like FFIND WINWORD\*.DOC (The $1 parameter in the macro would be replaced with WINWORD\*.DOC.) -=------------=- T-H-E E-N-D F-O-R N-O-W -=------------=-