Using RENAME (REN)

 < Day Day Up > 

Using RENAME ( REN )

The RENAME command (can be abbreviated REN ) can be used to rename one or more files through the use of the ? and * wildcards. RENAME uses the same syntax with any version of Windows:

 J:\>rename /? Renames a file or files. RENAME [drive:][path]filename1 filename2. REN [drive:][path]filename1 filename2. Note that you cannot specify a new drive or path for your destination file. 

For example, RENAME MYDOC.DOC MYNOVEL.DOC changes MYDOC.DOC to MYNOVEL.DOC . RENAME *.BAK *.OLD changes all *.BAK files in the current folder to *.OLD.

graphics/note_icon.gif

Windows 9x/Me cannot use DEL / ERASE to delete system, hidden, or read-only files. However, Windows NT/2000/XP can delete these files with DEL / ERASE .


Using VER

The VER (Version) command can be used to determine the exact version of Windows in use. Unlike DIR , VER has no optional switches.

To use the VER command

  1. Open a command-prompt window.

  2. Type VER and press Enter.

  3. The version number information will be displayed.

Table WCR.1 lists major version information for the Windows versions covered on the A+ Certification Exam.

Table WCR.1. Windows Version Information As Displayed by VER

Windows Version

VER Displays

Windows 95 (original)

Windows 95 [Version 4.00.950]

Windows 95 with Service Pack 1 or OEM Service Release 1

Windows 95 [Version 4.00.950 A]

Windows 95 with OEM Service Release 2

Windows 95 [Version 4.00.950 B]

Windows 95 with OEM Service Release 2 and USB supplement

Windows 95 [Version 4.00.950 C]

Windows NT 4.0 Workstation

Windows NT [Version 4.00.1381]

Windows 98 (original)

Windows 98 [Version 4.10.1998]

Windows 98 Second Edition (or original with Second Edition updates CD)

Windows 98 [Version 4.10.2222A]

Windows Me

Windows Me [Version 4.90.3000]

Windows 2000

Windows 2000 [Version 5.00.2195]

Windows XP (includes Service Pack 1)

Windows XP [Version 5.1.2600]

Using COPY

The COPY command copies files from one drive and folder to another folder and drive. The folder specified by COPY must already exist on the target drive. COPY will not work with files that have the system or hidden file attributes; to copy these files, use XCOPY32 instead.

The options for COPY (Windows 9x/Me) are

 A:\>COPY/? Copies one or more files to another location. COPY [/A  /B] source [/A  /B] [+ source [/A  /B] [+ ...]] [destination   [/A  /B]] [/V] [/Y  /-Y]   source       Specifies the file or files to be copied.   /A           Indicates an ASCII text file.   /B           Indicates a binary file.   destination  Specifies the directory and/or filename for the new                file(s).   /V           Verifies that new files are written correctly.   /Y           Suppresses prompting to confirm you want to overwrite an                existing destination file.   /-Y          Causes prompting to confirm you want to overwrite an                existing destination file. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format). 

Windows 2000/XP add the following options:

 Default is to prompt on overwrites unless COPY command is being executed from within a batch script. /D          Allow the destination file to be created decrypted /N           Uses short filename, if available, when copying a file with a              non-8dot3 name. /Z           Copies networked files in restartable mode. 

To use the COPY command

  1. Open a command-prompt window or boot the system to a command prompt.

  2. Type COPY followed by the filename or names and destination drive or folder.

  3. Press Enter.

Here are some examples:

  • COPY *.* A: Copies all files in the current folder to the current folder on the A: drive.

  • COPY *.TXT C:\Mydocu~1 Copies all .txt files in the current folder to the Mydocu~1 folder on the C: drive.

  • COPY C:\WINDOWS\TEMP\*.BAK Copies all *.bak files in the \Windows\Temp folder on drive C: to the current folder.

  • COPY C:\WINDOWS\*.BMP D: Copies all .bmp files in the \Windows folder on drive C: to the current folder on drive D:.

Using SET

The SET command is used to view or change environmental variables; these variables affect the operation of Windows and specific hardware or software. With Windows 9x/Me, SET statements can be placed in Autoexec.bat for execution at the next startup. To configure the current command-prompt session in Windows NT/2000/XP, you can use SET statements at the command prompt.

tip

graphics/tip_icon.gif

If you need to create a variable with SET for use with an MS-DOS program running under Windows NT/2000/XP, edit the Autoexec.nt file located in the System32 folder beneath the default Windows folder.


graphics/arrow_icon.gif

To change environmental variables at startup with Windows NT/2000/XP, see "Temporary File Settings in Windows NT/2000/XP," p. 675 .


Open a command prompt and enter SET with no options to see the current environmental variables.

Some typical uses for SET include

  • Changing the location of temporary files : SET TEMP=D:\TEMP

  • Configuring the path to command-prompt utilities : SET PATH=C:\WINDOWS\COMMAND; C:\WINDOWS

 < 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