Pen drive size is displayed but not contents

ATTRIB Command

attrib is a command, in DOS, OS/2 and Microsoft Windows. The function of attrib is to set and remove file attributes (read-only, archive, system and hidden).
There are four attributes in Windows files:

  • (r) Read-only file attribute
  • (a) Archive file attribute
  • (s) System file attribute
  • (h) Hidden file attribute

One or more of these attributes can be set [+x] or cleared [-x] in a single instance of the command for a specific file, file type, folder or and entire branch of the directory structure (a directory, including all sub-directories). There are three optional switches that can be applied at the end of the DOS command string, although not all switches are recognized for all versions of Windows. These switches are:

  • /S also apply changes to subdirectories of current directory
  • /D also apply changes to folder names (this only applies for Windows 2000 and Windows XP)
  • /L apply to symbolic link itself instead of the target of the symbolic link (introduced with Windows Vista and Windows Server 2008)

The general attrib command syntax is:

attrib [+r|-r] [+a|-a] [+h|-h] [+s|-s] [d:][path]filename [/s] [/d] [/l]

For example, to remove the read-only and hidden file attributes for all files in a directory tree:

attrib -r -h *.* /s /d

Note, the -s parameter will also remove the system attribute for files and should always be used with care and should not be used for genuine system files.

Showing pen drive hidden contents

Showing pen drive hidden contents when pen drive showing size of full contents, but not showing actual contents. (hidden things)

attrib -h -r -s /s /d g:\*.*

Here g:(g drive is your pen drive in computer, replace this letter with a appropriate drive for which contents are not shown)


You may also like...

1 Response

  1. deepak uniyal says:

    Excellent fix