< Day Day Up > |
File management skills such as file creation, filenaming, file attributes, compression, encryption, file permissions, and file types are important parts of the A+ Certification Operating System Exam. The following sections discuss these skills. Creating FilesData files that can be accessed by registered applications can be created within the Windows Explorer/My Computer interface. To create a new file
File TypesBroadly speaking, there are two types of files used by Windows and other operating systems:
Text files can be read with an ordinary text editor such as Notepad or Edit. However, most word processing and other types of document files, although they contain text, also contain formatting characters that a text editor cannot properly interpret. Binary files look like gibberish when viewed in a text editor. Only the operating system (in the case of application binary files) or a compatible application (in the case of binary data files) can interpret their contents. The following types of files can be started (executed) from a command prompt or from Windows Explorer/My Computer:
Both .EXE and .COM files are binary executable files, whereas a .BAT file (also called a batch file) is a series of commands that are processed in sequence. Simple batch files contain the same commands that could be entered manually at a command prompt. However, it is also possible to create batch files that have conditional logic and display progress messages. When an executable filename is entered at a command prompt, the current folder is searched first, followed by the folders in the path. If executable files in the current folder or a folder in the path have .COM, .EXE, and .BAT extensions with the same name preceding the extension, the .COM file is always launched first. For example, assume that the current folder contains DOIT.COM , DOIT.EXE , and DOIT.BAT . DOIT.COM is launched if you enter DOIT . Naming FilesAll versions of Windows covered on the A+ Certification Exams support long file and folder names ( LFN ). LFNs can be up to 255 characters and can contain spaces and most other alphanumeric characters, but cannot contain any of the following characters (which are used by the operating system):
A file can contain more than one period, but only the characters after the last period are considered the extension. In the following example, .doc is the extension: mydocument.ltr.doc By default, the Windows Explorer doesn't show file extensions for registered file types. You can adjust the settings in Windows Explorer to show all file extensions, right-click a file and view properties in Windows Explorer, or use the DIR command from a command prompt to view the extension for a specified file.
Long Filenames and DOS Alias NamesTo enable files to be accessed by DOS, older versions of Windows, and operating systems that don't support long filenames, Windows stores a DOS alias (also known as the MS-DOS name) as well as the LFN when a file or folder is created. The DOS alias name is created from the first six letters of the LFN, replacing illegal characters with an underscore , removing spaces, and ignoring additional periods in the LFN. To distinguish between different files with the same DOS alias names, the first DOS alias name in a folder is indicated with a tilde and the number 1 (~1); the second as ~2, and so on. If more than nine files with the same initial letters are saved to a given folder, the first five letters are used for files numbered ~10 and up, and so forth. The three-letter file extension is reused for the DOS alias. Table 18.6 shows the results of creating three files with the same initial files in the same folder. The underlined characters in the original LFN in Table 18.6 are used to create the DOS alias name. caution
Table 18.6. Examples of Creating DOS Aliases from LFNs
There is a limit of 255 characters for LFNs. However, the path to the file counts against this limit. Differences in LFN Support by Windows VersionWindows 9x/Me's command-prompt mode uses DOS alias names by default. For example, if you want to change to the My Documents folder from the command prompt, you must use the DOS alias: cd\mydocu~1
Only DOS alias names are shown for files and folders if you use the DIR command when you boot from a Windows EBD. You must use DOS alias names for any disk commands when you boot from a Windows EBD (or a DOS floppy). However, if you start a command prompt from within the Windows 9x/Me GUI, you can use the LFN if you use quote marks around the LFN: cd\"My Documents" Windows NT 4.0/2000/XP use LFNs by default; DOS alias names are used only for backward compatibility with other operating systems. The command-prompt mode uses LFNs with no special options. example, to change to My Documents, the command would be cd\My Documents caution
The Recovery Console used by Windows 2000 and XP for troubleshooting and system recovery also supports LFNs. File ExtensionsBy default, Windows hides file extensions such as .BAT, .DOC, and .EXE for registered file types. However, you can change this default in Windows Explorer/My Computer.
Setting and Displaying File and Folder Attributes in Windows ExplorerYou've probably heard of file attributes , but what are they used for? File and folder attributes are used to indicate which files/folders have been backed up, which files/folders need to be backed up, which files/folders should be hidden from normal display, and which files/folders are used by the system. Windows also supports additional attributes such as when a file/folder was created and last modified. When the NTFS file system is used on a drive, additional advanced attributes (encryption or compression) are also available. The ATTRIB command can be used to set or display basic attributes for a file/folder from the Windows command line. However, to set or display advanced file attributes, you must use the Windows ExplorerGUI interface. Basic file attributes include
Windows 9x/Me File AttributesTo view the attributes for a file or folder with Windows Explorer
To add an attribute, check the box next to the attribute and click Apply. To remove an attribute, clear the check box next to the attribute and click Apply. Windows NT 4.0/2000/XP File AttributesWindows 2000/XP use only three of the basic file attributes used by Windows 9x/Me:
Windows NT 4.0 also supports the System attribute. To view these attributes with the Windows 2000/XP Explorer
To select or deselect the archive attribute, or to set encryption or compression options on a drive using the NTFS file system, click the Advanced button. Figure 18.26 shows the General and Advanced dialogs on a Windows 2000 system (Windows XP is similar). Figure 18.26. Compressing a file with Windows 2000. You can select compression or encryption, but not both.
Encryption and compression are available only on Windows 2000 and XP drives formatted with the NTFS file system. (Windows NT 4.0 supports compression, but not encryption.) To set these options for a file or folder in Windows 2000/XP, you can use the Windows Explorer or the command-line programs Compact (to compress a file) or Cipher (to encrypt a file); Windows NT 4.0 also uses Cipher. To encrypt or compress a file with the Windows 2000/XP GUI, follow these steps:
caution
File PermissionsWindows NT 4.0/2000/XP systems that use the NTFS file system feature an additional tab on the file/folder properties sheet called the Security tab. It is used to control file permissions . The Security tab permits you to control access to the selected file or folder by granting or denying permissions shown to selected users or groups:
The Security tab has two sections. The top section shows the users and groups that have access to the selected file or folder. You can add or remove groups or users. The bottom section lets you specify the permissions available for the selected user or group . Locating Files and FoldersWindows NT 4.0/9x/Me use the Find command to locate files and folders, computers on a network, Internet content and other options, whereas Windows 2000/XP calls this option Search . To start the process of locating a file or folder, open the Windows Start menu and click Find (Windows NT 4.0/9x/Me) or Search (Windows 2000/XP). Windows NT 4.0/9x/Me use a small, multitabbed window for their Find command; Windows 2000 and Windows XP use the Windows Explorer for their Search command. Each is discussed separately.
Using Windows FindTo find a file or folder with Windows Find
You can also customize the search by specifying text contained in the file, the range of dates to search, the size range of the files to search, the type(s) of files to search, and whether to search only the specified location or the specified location and its subfolders . Using Windows 2000 SearchThe Windows 2000 Search tool offers similar options to the Windows Find tool, although it uses the Windows 2000 Explorer. The following are some differences:
Using Windows XP SearchThe Windows XP Search interface is completely different than previous versions of Windows (see Figure 18.28). The task pane on the left side of the screen contains options to search by specific file types (pictures/photos, music, videos , documents) and search-supported tape backups . As with other versions of Windows, you can also specify partial or exact filenames and file text. Figure 18.28. The results of searching the Windows XP system drive (J:) for files containing note in the filename (right) and the search options used (left).
|
< Day Day Up > |