You are on page 1of 3

ATTRIB.exe Display or change file attributes. Find Filenames.

Syntax ATTRIB [ + attribute | - attribute ] [pathname] [/S [/D]] Key + : Turn an attribute ON : Clear an attribute OFF

pathname : Drive and/or filename e.g. C:\*.txt /S : Search the pathname including all subfolders. /D : Process folders as well attributes: R H A S Read-only (1) Hidden (2) Archive (32) System (4)

extended attributes: E Encrypted C Compressed (128:read-only) I Not content-indexed L Symbolic link/Junction (64:read-only) N Normal (0: cannot be used for file selection) O Offline P Sparse file T Temporary The numeric values may be used when changing attributes with VBS/WSH If no attribute is specified attrib will return the current attribute settings. Used with just the /S option ATTRIB will quickly search for a particular filenam e. Hidden and System attributes take priority. If a file has both the Hidden and System attributes set, you can clear both attr ibutes only with a single ATTRIB command. For example, to clear the Hidden and System attributes for the RECORD.TXT file, you would type: ATTRIB -S -H RECORD.TXT File Attributes You can use wildcards (? and *) with the filename parameter to display or change the attributes for a group of files. Remember that, if a file has the System or Hidden attribute set, you must clear that attribute before you can change any other attributes. Directory Attributes You can display or change the attributes for a directory/folder. To use ATTRIB w ith a directory, you must explicitly specify the directory name; you cannot use wildcards to work with directories. For example, to hide the directory C:\SECRET, you would type the following:

ATTRIB +H C:\SECRET The following command would affect only files, not directories: ATTRIB +H C:*.* The Read-only attribute for a folder is generally ignored by applications, howev er the Read-only and System attributes are used by Windows Explorer to determine whether the folder is a special folder, such as My Documents, Favorites, Fonts, etc. Setting the Read-Only attribute on a folder can affect performance, particularly on shared drives because Windows Explorer will be forced to request the Desktop .ini of every sub-folder to see if any special folder settings need to be set. Viewing archive attributes The Archive attribute (A) is used to mark files that have changed since they wer e previously backed up. The (A) flag is automatically updated by Windows as the file is saved. If the (A) flag is present - the file is new or has been changed since the last backup. The MSBACKUP, RESTORE, and XCOPY commands use these Archive attributes, as do ma ny (but not all) 3rd party backup solutions. Constants - the following attribute values are returned by the GetFileAttributes function: FILE_ATTRIBUTE_READONLY = 1 FILE_ATTRIBUTE_HIDDEN = 2 FILE_ATTRIBUTE_SYSTEM = 4 FILE_ATTRIBUTE_DIRECTORY = 16 FILE_ATTRIBUTE_ARCHIVE = 32 FILE_ATTRIBUTE_ENCRYPTED = 64 FILE_ATTRIBUTE_NORMAL = 128 FILE_ATTRIBUTE_TEMPORARY = 256 FILE_ATTRIBUTE_SPARSE_FILE = 512 FILE_ATTRIBUTE_REPARSE_POINT = 1024 FILE_ATTRIBUTE_COMPRESSED = 2048 FILE_ATTRIBUTE_OFFLINE = 4096 FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192 "The moral sense of conscience is by far the most important.. it is the most nob le of all the attributes of man" - Charles Darwin Related: CACLS - Change file permissions Show superhidden file extensions Q326549 - Read-only & System attributes for folders Equivalent bash command (Linux): chmod - Change access permissions

Copyright SS64.com 1999-2011 Some rights reserved ---------------------------------------------------------------------------------------------------------------------------------------------------------

DOS DIR Complete Dir dir *.* >> dir.txt Complete Dir dir > print.txt Only File Name dir/b > print.txt ================================== ot much different than Linux. dir *.pdf > fileyouwant.txt If you only want the filenames, you can do that with dir/b *.pdf > fileyouwant.txt If you also want subdirs, dir/s/b *.pdf > fileyouwant.txt If you aren't in that directory to start with dir/s/b C:\Path\*.pdf > fileyouwant.txt -----------------------------------------------------How to remove blank space in excel 1. 2. =TRIM(SUBSTITUTE(B2,CHAR(160),CHAR(32))) =SUBSTITUTE(A1," ","")

3. Or even select the range first and edit|replace what: (spacebar) with: ( leave empty) replace all. 4.

You might also like