Category : Assembly Language Source Code
Archive   : DOCFILES.ZIP
Filename : NO.DOC

 
Output of file : NO.DOC contained in archive : DOCFILES.ZIP

NO Charles Petzold
Command PC Magazine Vol 5, No 9
Copyright 1986 Ziff-Davis Publishing Company
______________________________________________________

Purpose: Excludes specified files in a subdirectory
from the action of a command.

Format: NO filespec Command [parameter]

Remarks: NO.COM is designed for situations in which
you want to apply a command such as DELete or
COPY to all the files in a directory except
one or two (or a class of) files. For
example,

NO *.BAS COPY *.* A:

copies all the files in your current
subdirectory to drive A: except for those
that have a .BAS extension.

To exclude more than one file (or category)
you must use a separate NO command for each
on the command line. Thus,

NO *.ASM NO *.COM DEL *.*

deletes all files in the current directory
except those with .ASM or .COM extensions.

Notes:

1. NO.COM should not be used in conjunction
with the PC-DOS BACKUP and RESTORE
commands. This is because NO operates
by temporarily setting the "hidden" file
attribute bit on the files to be
excluded from the main command, then
unhiding the files after the main
command has been executed. Since the
DOS BACKUP/RESTORE operation acts on
hidden and unhidden files alike, NO.COM
cannot be used to exclude files from
BACKUP/RESTORE. RESTORE, indeed, will
restore the supposedly excluded files as
hidden, overwriting the originals.

2. While NO.COM provides full path support
(and so requires the use of DOS 2.0 or
later), it is a good policy when using
NO to use CHDIR to make the directory
that contains the files on which you
wish to operate the current directory.

For example, suppose you are in your
root directory, one of whose subdirec-
tories is \BASIC. If you were to enter
the command

NO *.BAS DEL \BASIC\*.*

you would not delete all the files in
the \BASIC subdirectory except those
with a .BAS extension, as you might have
intended to do. To do this from the
root directory you would have had to
enter

NO \BASIC\*.BAS DEL \BASIC\*.*

This complete filespec would tell NO
that it had to protect files in the
\BASIC, not in the current (i.e., root)
directory.

If you follow our recommendation and
enter

CD \BASIC
NO *.BAS DEL *.*

thus making \BASIC your current
directory before you start deleting, you
will then clean out all but the .BAS
files, just as you intended.

3. Should a parity check error, power
outage, or system crash occur during the
brief period between the times NO hides
and subsequently unhides the protected
files, those files will subsequently
seem to have disappeared. They are not
lost; only hidden from a DIR listing.
Use ATTR.COM (included in this set of
utilities) to change their hidden
status.





  3 Responses to “Category : Assembly Language Source Code
Archive   : DOCFILES.ZIP
Filename : NO.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/