[comp.sys.ibm.pc] Hidden Subdirectories

jdf@pbhyc.UUCP (Jack Fine) (01/13/87)

Got a question.  Can I make a subdirectory hidden like a hidden file?  And
if so, can I then access it like a normal subdirectory?  If all this can be
done, how?

I think I may be asking a lot but hopefully it can be done.

Thanks

Jack

duke@gitpyr.gatech.EDU (ROY BRABSON) (01/14/87)

In article <568@pbhyc.UUCP> you write:
>
>Got a question.  Can I make a subdirectory hidden like a hidden file?  And
>if so, can I then access it like a normal subdirectory?  If all this can be
>done, how?
>
>I think I may be asking a lot but hopefully it can be done.
>

Yes, you can hide subdirectories (just as you can hide files) and can accesses
them as though they were ordinarry subdirectories.  Below is a small
assembly language program which will do just that.  To create the two .com 
files, type the instructions below into a file named script, using
a pure ASCII text editor.  Then, with Debug.Com on the same diskette, type
DEBUG<SCRIPT.  This will contain two files, HIDE.COM and UNHIDE.COM.  
HIDE.COM will hide either both files and directories, and UNHIDE.COM will
make hidden files or subdirectories visible again.  Remember
when typing in the following to include all blank lines and hit
the return key after each line, including the last.   
NOTE:  Although I would like to take the credit for the following programs, 
       I didn't write them.  I found them in some magazine (can't
       remember which)

-----------------------------------------------------
    N UNHIDE.COM
    A
    MOV BX,80
    INC BX
    CMP BYTE PTR [BX],20
    JZ 103
    MOV DX,BX
    INC BX
    CMP BYTE PTR [BX],D
    JZ 116
    CMP BYTE PTR [BX],0
    JNZ 10B
    MOV BYTE PTR [BX],0
    MOV CX,20
    MOV AL,1
    MOV AH,43
    INT 21
    INT 20

    RCX
    24
    W
    N HIDE.COM
    A 119
    MOV CX,27

    W
    Q

--------------------------------------------------------
Hope you find these useful.  I use these programs to hide all files in
my root directory (config.sys, autoexec.bat, command.com) so that the only
things which show up during a DIR are directories.  I haven't really used it
much on hiding directories, but have tested it and it does work.  Hope you
enjoy them.
-- 
Roy Brabson
Georgia Insitute of Technology, Atlanta Georgia, 30332
uucp: ...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!duke
ARPA: duke@pyr.ocs.gatech.edu

kuo@skatter.UUCP (01/18/87)

In article <568@pbhyc.UUCP>, jdf@pbhyc.UUCP (Jack Fine) writes:
> 
> Got a question.  Can I make a subdirectory hidden like a hidden file?  And
> if so, can I then access it like a normal subdirectory?  If all this can be
> done, how?
> I think I may be asking a lot but hopefully it can be done.

You can hide a directory no problem. As long as you don't forget the
name (and read-protect it) you can access it.

philip@amdcad.UUCP (01/18/87)

In article <568@pbhyc.UUCP> jdf@pbhyc.UUCP (Jack Fine) writes:
>
>Got a question.  Can I make a subdirectory hidden like a hidden file?  And
>if so, can I then access it like a normal subdirectory?  If all this can be
>done, how?
>
>I think I may be asking a lot but hopefully it can be done.
>
>Thanks
>
>Jack

I've seen this done, but it was with a sub-directory name of non-displayable
characters.  There exists a PD package of programs that ar called:
	MDSKRT		make directory secret
	CDSKRT		change directory secret
	RDSKRT		remove directory secret
when you list directories, the secret entries dont appear, but once you
have cd'ed to it you can access the files.  Pathnames cant include these
secret subdirectories (because you cant type it in)  
You should be able to find this software on a BBS near you

iav1917@ritcv.UUCP (alan i. vymetalik) (01/20/87)

[Etched along the walls of the CD's groove, the words "EAT HOT LASER DEATH!"]

In article <14366@amdcad.UUCP> philip@amdcad.UUCP (Philip Freidin) writes:
>In article <568@pbhyc.UUCP> jdf@pbhyc.UUCP (Jack Fine) writes:
>>
>>Got a question.  Can I make a subdirectory hidden like a hidden file?  And
>>if so, can I then access it like a normal subdirectory?  If all this can be
>>done, how?
>>
>I've seen this done, but it was with a sub-directory name of non-displayable
>characters.  There exists a PD package of programs that ar called:
>	MDSKRT		make directory secret
>	CDSKRT		change directory secret
>	RDSKRT		remove directory secret


   Plug for PD-software... 

   Simply use CHMOD by Gene Cohler (as posted to this newsgroup earlier).

   CHMOD will allow you set EVERY attribute bit on a directory or regular
   file.  You can set the 'h'idden, 's'ystem, 'a'rchive, 'r'ead-only bit.
   Setting the 'r'ead-only bit, however, doesn't make a 'read-only'
   directory which would be very desirable.  This is a limitation of DOS
   rather than CHMOD.  It seems DOS only checks the attribute of the file
   you're about to delete rather than any attributes set for the parent
   directory.  So, just change all the files in the sub-directory with:
   CHMOD +r *.* .  Simple enough!

   Now, once these files and subdirectories are hidden, all programs like
   DPATH, SEARCH, and other such beasts can find the all of the files and
   subdirectories with no problem.  I've 'uncluttered' my 10mb disk's root
   directory and it drives clients buggy that they can't 'see any files on
   on the disk!'  Using 1-Dir or other superdirectory programs makes the
   files and directories easily visible.  I set one of the directories
   will every attribute A,D,S,H,R.  Different!  Only draw back is, of course,
   you can't modify the 'd'irectory bit.

   Highly recommended...

   Please contact the author.  The CHMOD programs comes with MSC V4.0 source,
   .EXE, and .DOC file.

   The author:
       Gene Cohler
       Newman Lab, Cornell University, Ithaca, New York, 14853
       cohler@tcgould.tn.cornell.edu
       jbvy@cornella.bitnet


   Enjoy,
   Alan

   "Remember to always keep an open mind.  But,
   not so open so that your brains fall out!"
   =================================================
                                   alan i. vymetalik
   uucp:    {allegra,seismo}!rochester!ritcv!iav1917
   =================================================

cpc@vaxine.UUCP (Chris Cullen) (01/20/87)

> In article <568@pbhyc.UUCP> jdf@pbhyc.UUCP (Jack Fine) writes:
> >
> >Got a question.  Can I make a subdirectory hidden like a hidden file?  And
> >if so, can I then access it like a normal subdirectory?  If all this can be
> >done, how?
> >
> >I think I may be asking a lot but hopefully it can be done.
> >
> >Thanks
> >
> >Jack
> 
> I've seen this done, but it was with a sub-directory name of non-displayable
> characters.  There exists a PD package of programs that ar called:
> 	MDSKRT		make directory secret
> 	CDSKRT		change directory secret
> 	RDSKRT		remove directory secret
> when you list directories, the secret entries dont appear, but once you
> have cd'ed to it you can access the files.  Pathnames cant include these
> secret subdirectories (because you cant type it in)  
> You should be able to find this software on a BBS near you

The easiest way is just to make a normal directory, then hide it using
'chmod' which was recently posted.  Get a look at it with 'ls', a little
less recently posted. Why make yet more special-purpose utilities when
the general ones are so useful?

All commands that access files in the directory work as before; you just
have to know it's there.
-- 
-- 
Chris Cullen                UUCP: {ucbvax!allegra,decvax}!encore!vaxine!cpc
Automatix, Inc.             Phone: 617-667-7900 x2066
1000 Technology Park Dr.
Billerica, Mass. 01821

hrs@homxb.UUCP (01/24/87)

In article <40@ritcv.UUCP>, iav1917@ritcv.UUCP (alan i. vymetalik) writes:
> [Etched along the walls of the CD's groove, the words "EAT HOT LASER DEATH!"]
> 
> In article <14366@amdcad.UUCP> philip@amdcad.UUCP (Philip Freidin) writes:
> >In article <568@pbhyc.UUCP> jdf@pbhyc.UUCP (Jack Fine) writes:
> >>
> 
>    Plug for PD-software... 
> 
>    Simply use CHMOD by Gene Cohler (as posted to this newsgroup earlier).
> 
The version of DOS that I have, supplied by AT&T for the pc6300,
has the command CHMOD in it.
It seems to do the same things as the one posted here.  Since it came as part of Microsoft DOS, is it still public domain?

Herman Silbiger ...!ihnp4!homxb!hrs

rxb@rayssdb.UUCP (01/27/87)

   Altering the attributes of files and directories is a painless,
   simple process. Here the story:


-------------------------------------------------------------------------------- 
	The DIRECTORY of a DOS Formatted disk ( as well as all SubDirectory
 	entries) is formatted as follows:

	Field	Offset	Size 	Description      
	-----   ------  ----    ------------------------------------------
	  1       0      8      Filename (Directory Name, or Label) - ASCII
          2       8      3      Filename Extension                  - ASCII
          3       11     1      Attribute (See Below)
          4       12     10     UnUsed (should be zero's)
          5       22     2      Time 
          6       24     2      Date
          7       26     2      Starting FAT entry
          8       28     4      File Size


       Field 3 describes the file (or SubDirectory) as follows:

                  Bit            Description
        7  6  5  4  3  2  1  0  
      ----------------------------------------------------------------------
        -U -  -  -  -  -  -  1   Read Only File
        -U -  -  -  -  -  1  -   Hidden File or Sub Directory
        -U -  -  -  -  1  -  -   System File
        -U -  -  -  1  -  -  -   Volume ID Label
        -U -  -  1  -  -  -  -   Sub-Directory
        -U -  1  -  -  -  -  -   Archive File

		bits 7,6 are unused (0)

	To modify a file or Sub-Directory simply change the attribute
 	bits using Debug or Norton Utilities (or any other utility that
        allows you to read,modify and write disk data).

	For example, to hide a file change the file attribute from 00H
	(or 20H for Archive file) to 02H (or 22H). Changing the attribute
	to 03H will make the file Hidden AND Read Only.

	Another trick used by some people is to change the FIRST char-
	acter of the file name to an Un-Printable character ( IBM graphic
	character). This will make the file unusable by the KEYBOARD, but
	may still be called by another program. 

   	The same applies to Sub-Directories. I often purchase software, pop
	it into the drive and type DIR, only to find ONE batch file (size
	128 bytes) and NO SPACE AVAILABLE on the disk!!!! Upon running
	Norton Utilities I find that ALL FILES are located in a directory
	whose first character is a graphic character!!!

	Well enjoy your disks with this info!!!

iav1917@ritcv.UUCP (01/27/87)

[Ouch!]

In article <2336@homxb.UUCP> hrs@homxb.UUCP (H.SILBIGER) writes:
>In article <40@ritcv.UUCP>, iav1917@ritcv.UUCP (alan i. vymetalik) writes:
>> In article <14366@amdcad.UUCP> philip@amdcad.UUCP (Philip Freidin) writes:
>> >In article <568@pbhyc.UUCP> jdf@pbhyc.UUCP (Jack Fine) writes:
>> 
>>    Plug for PD-software... 
>> 
>>    Simply use CHMOD by Gene Cohler (as posted to this newsgroup earlier).
>> 
>The version of DOS that I have, supplied by AT&T for the pc6300,
>has the command CHMOD in it.

   Unless AT&T has placed a trademark on "CHMOD", the program supplied
   earlier on the net was a public domain program.  It included source,
   documentation, and the program.  While I did not compare the source
   against any Un*x or AT&T MS-DOS versions of CHMOD, it `appears' to be
   original.

   I wasn't aware that the AT&T version could touch sub-directories.
   I've been away from the 6300 for a long time and memory fades...

   Alan

   "A grain?!  Better use the whole bag!"
   =================================================
                                   alan i. vymetalik
   uucp:    {allegra,seismo}!rochester!ritcv!iav1917
   =================================================

psfales@ihlpl.UUCP (01/29/87)

> 
>    Altering the attributes of files and directories is a painless,
>    simple process. Here the story:

	[ . . . ]

> 	To modify a file or Sub-Directory simply change the attribute
>  	bits using Debug or Norton Utilities (or any other utility that
>         allows you to read,modify and write disk data).

	[ . . . ]

Aargh!  You are right that altering the attributes of files and directories
is a painless, simple process but I wouldn't call using debug or Norton
painless - One typo and you've just wiped out your whole disk.

Nearly every BBS has several programs for changing file attributes 
(usually called ALTER, HIDE, or CHMOD) to simplify this process.
Some versions of MS-DOS (i.g. the AT&T version) also come with the CHMOD
command.

Peter "Down with  Debug" Fales
-- 
Peter Fales		UUCP:	...ihnp4!ihlpl!psfales
			work:	(312) 979-7784
				AT&T Information Systems, IW 1Z-243
				1100 E. Warrenville Rd., IL 60566

madd@bucsb.bu.edu.UUCP (02/06/87)

In article <260@skatter.UUCP> kuo@skatter.UUCP (Dr. Peter Kuo) writes:
>In article <568@pbhyc.UUCP>, jdf@pbhyc.UUCP (Jack Fine) writes:
>> 
>> Got a question.  Can I make a subdirectory hidden like a hidden file?  And
>> if so, can I then access it like a normal subdirectory?  If all this can be
>> done, how?
>> I think I may be asking a lot but hopefully it can be done.
>
>You can hide a directory no problem. As long as you don't forget the
>name (and read-protect it) you can access it.

Hiding directories is accomplished in exactly the same manner as hiding
files, from a dos standpoint.  You call the dos chmod command (I can never
remember the silly function call numbers, so check your tech ref).  Tell
it to chmod the file and give it "hidden" or "system" attributes.  If the
"file" turns out to be a directory, dos still doesn't care.  As for forgetting
the name, it is trivial to tell the find first/find next functions that
dos provides to look for hidden/system files.  In fact, the only directory
printing program I have made displays EVERY file, whether it's hidden or
not.  It works much like UNIX's ls -al would (showing the file attributes).
Since it's so easy to find a "hidden" file, I wouldn't worry about forgetting
the name.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                   - Jim Frost * The Madd Hacker -
UUCP:  ..!harvard!bu-cs!bucsb!madd | ARPANET: madd@bucsb.bu.edu
CSNET: madd%bucsb@bu-cs            | BITNET:  cscc71c@bostonu
-------------------------------+---+------------------------------------
"Oh beer, oh beer." -- Me      |      [=(BEER) <- Bud the Beer (cheers!)