File Management

 < 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 Files

Data files that can be accessed by registered applications can be created within the Windows Explorer/My Computer interface. To create a new file

  1. Open the folder where you want to create the file with My Computer/Windows Explorer.

  2. Right-click empty space in the right window and select New to display a list of registered file types (see Figure 18.24).

    Figure 18.24. Creating a new text document on drive E:.

    graphics/18fig24.jpg

  3. Move the mouse pointer to the file type desired and click it. The new (empty) file is created in the open folder.

  4. Enter a new name if desired.

  5. To edit the file, double-click it.

File Types

Broadly speaking, there are two types of files used by Windows and other operating systems:

  • Text

  • Binary

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:

  • .COM

  • .EXE

  • .BAT

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 Files

All 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.

graphics/note_icon.gif

If you boot with the Windows 9x/Me EBD or the Windows 2000/XP Recovery Console, LFNs are not visible; only DOS alias names for files and folders are visible.


Long Filenames and DOS Alias Names

To 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

graphics/caution_icon.gif

DOS alias names for existing files can change if the file is renamed or deleted and then re-created.


Table 18.6. Examples of Creating DOS Aliases from LFNs

File Creation Order

Original LFN

DOS Alias

First

Budget Process. xls

BUDGET~1.XLS

Second

Budget Proposal.2003. xls

BUDGET~2.XLS

Third

Budget History+2002. xls

BUDGET~3.XLS

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 Version

Windows 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 
graphics/note_icon.gif

For a comprehensive list of file extensions and their meanings, I recommend the WhatIs? Web site's "Every File Format in the World" section, which lists more than 3,100 file formats at www.whatis.com.


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

graphics/caution_icon.gif

Don't remove or alter the file extension if you rename a file. If you do, Windows won't be able to determine which program it should use to open the file.


The Recovery Console used by Windows 2000 and XP for troubleshooting and system recovery also supports LFNs.

File Extensions

By 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.

graphics/arrow_icon.gif

See "Changing Viewing Options in Windows Explorer," p. 628 .


Setting and Displaying File and Folder Attributes in Windows Explorer

You'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

  • Archive Files with the archive attribute have not yet been backed up. When you back up a file with XCOPY/XCOPY32 or any backup program, the archive bit is turned off. Change a file's attribute to archive to force a backup program to back it up if "changed files only" are being backed up.

  • Read-only Files with the read-only attribute cannot be deleted or overwritten at an MS-DOS prompt, and cannot be overwritten within a 32-bit Windows application. A read-only file can be deleted within Windows Explorer, but only after the user elects to override the read-only attribute. Change a file's attributes to read-only to provide protection against accidental deletion or changes.

  • System Files with the system attribute are used by the operating system, and often have the hidden attribute as well.

  • Hidden Files with the hidden attribute cannot be copied with COPY or with XCOPY and cannot be viewed with the normal Windows Explorer settings. Some log files created by Windows (such as Bootlog.txt ) are stored with the hidden attribute.

graphics/note_icon.gif

XCOPY32 (which runs only within the Windows GUI) can copy hidden files.


Windows 9x/Me File Attributes

To view the attributes for a file or folder with Windows Explorer

  1. Start Windows Explorer.

  2. Right-click a file or folder and select Properties.

  3. The General tab indicates attributes for the file or folder. In addition to the basic attributes listed previously, Windows 9x/Me can also display the creation date of the file, the date the file was last accessed, and the date the file was last changed (see Figure 18.25).

    Figure 18.25. This file has the archive attribute set, which can be used by a backup program to detect which files are not yet backed up (archived).

    graphics/18fig25.gif

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 Attributes

Windows 2000/XP use only three of the basic file attributes used by Windows 9x/Me:

  • Read-only

  • Hidden

  • Archive

Windows NT 4.0 also supports the System attribute.

To view these attributes with the Windows 2000/XP Explorer

  1. Start Windows Explorer.

  2. Right-click a file or folder and select Properties.

  3. The General tab indicates read-only or hidden attributes for the file or folder. In addition to the basic attributes listed previously, Windows 2000/XP can also display the creation date of the file, the date the file was last accessed, and the date the file was last changed.

graphics/note_icon.gif

Operating system files are stored in the default Windows folder ( \Windows or \WINNT ). Windows Explorer in Windows 2000/XP is configured not to display the contents of these folders by default.


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.

graphics/18fig26.gif

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:

  1. Start Windows Explorer/My Computer.

  2. Right-click a file or folder and click Properties.

  3. Click the Advanced button.

  4. Select Compression to reduce the disk space used by the file, or Encryption to restrict access to only the system's administrator or the user who encrypted the file.

  5. Click OK to apply either option (refer to Figure 18.26). Files can be compressed or encrypted, but not both.

  6. If you are encrypting the file, Windows recommends that you encrypt the folder containing the file (which will also encrypt the file).

caution

graphics/caution_icon.gif

Only the user who originally encrypted the file (or the system's Administrator) can open an encrypted file and view its contents. Only the Administrator can apply compression to a file or folder.


File Permissions

Windows 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:

  • Full Control Enables any and all changes to a file, including deletion.

  • Modify File can be modified.

  • Read & Execute File can be read and executed.

  • Read File can be read.

  • Write File can be overwritten.

graphics/note_icon.gif

File folders' properties sheets have additional tabs:

  • The Sharing tab configures how a folder is shared (if file/print sharing is installed).

  • The Customize tab (Windows XP) configures how a folder is displayed in My Computer/Windows Explorer.


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 Folders

Windows 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.

graphics/note_icon.gif

If Windows XP is configured to use simple file sharing, the Security tab will not be visible. Simple file sharing is recommended for home and small-business networks, but reduces system security. Simple file sharing is enabled by default if the system is not connected to a domain, but is disabled automatically when the system is connected to a domain (the domain controller is used to control network security).

To disable simple file sharing on a system not connected to a domain, click Start, Control Panel, Folder options; click View and clear the check mark next to Use Simple File Sharing (Recommended).


Using Windows Find

To find a file or folder with Windows Find

  1. Click Start, Find, Files or Folders.

  2. Enter the file or folder name (or a portion of the name) in the Named field on the Name & Location tab; you can use wildcards such as the following:

    • note* Finds all files or folders starting with note

    • *note Finds all files or folders ending with note

    • *note* Finds all files or folders containing note anywhere in the name

    You also can click the down arrow to reuse a previous search.

  3. Select the drives or other locations to search with the Look In menu.

  4. Click Find Now to begin the search (see Figure 18.27).

    Figure 18.27. All files containing note in the filename on local or mapped drives are located by a search specifying *note* and My Computer.

    graphics/18fig27.jpg

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 Search

The Windows 2000 Search tool offers similar options to the Windows Find tool, although it uses the Windows 2000 Explorer. The following are some differences:

  • Search options are not displayed unless you click the Search Options box.

  • To specify values for each search option, click the check mark box next to the search option.

  • Advanced options also include

    • Case Sensitive This option enables you to specify capital or small letters in your search.

    • Search Slow Files This option will temporarily copy files on removable media to your system's hard disk to speed up searches.

Using Windows XP Search

The 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).

graphics/18fig28.jpg

 < Day Day Up > 


Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam
Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 310

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net