0% found this document useful (0 votes)
4 views6 pages

DOS Commands Lab: Move, Date, Time, Color

Uploaded by

prince94829434
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

DOS Commands Lab: Move, Date, Time, Color

Uploaded by

prince94829434
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BCA – 105: Lab on MS- Windows and DOS

Rahul Kumar Singh

In today's Lab Class we have discussed on different DOS


internal Commands.

9) Move Command:-

The move command allows users to transfer files or


directories from one directory to another, or from one drive
to another.

Syntax:-

MOVE [drive:][path]file name1[,...] destination

Example:-

move c:\windows\temp\*.* c:\temp

Move the files of c:\windows\temp to the temp directory in


root, this is of course assuming you have the
Windows\temp directory. In this example, *.* is wildcards
telling the computer every file with every extension.

move "computer hope" example

If your directory name or file name has a space, it must be


surrounded with quotes, otherwise you get a "The syntax of
the command is incorrect." error message. The command
above would move the "computer hope" directory into the
example directory contained in the same directory (current
directory).
move c:\[Link] h:

The command above moves the file [Link] into the h:


drive. In this example, the h: drive is a USB flash drive. The
drive letter can vary depending on the other drives
connected to the computer.

10) Date Command:-

The date command can view or change the current date of


the system clock.

Syntax:-

date [ /t | date ]

Type date without parameters to display the current date


setting and a prompt for a new date. Press Enter to keep
the same date.

If you provide a date in the format MM-DD-YY, the system


date is set to that date.

With the /t switch, the date command displays the system


date, without prompting for a new one.

Examples:-

date

Display the current date and prompt for a new date.

The current date is: Sat 05/09/2020


Enter the new date: (mm-dd-yy)

If you enter a new date in the format MM-DD-YY, the


system date is set to that date, if you are using an elevated
Command Prompt.

If you press Enter without typing a date, the current system


date is not changed, and the command exits.

date 05-08-20

The command above sets the system date to March 8,


2020, in an elevated command prompt.

date /t

Displays the current system date.

Sat 05/09/2020

11) Time Command:-

The time command allows the user to view and edit the
computer's time.

Syntax:-

TIME [/T | time]

Type TIME with no parameters to display the current time


setting and a prompt for a new time. Press Enter to keep
the same time.

If Command Extensions are enabled, the TIME command


supports the /T switch which tells the command to only
output the current time without prompting for a new time.

Examples:-

time

Typing "time" alone displays the current time and give you
the option to enter a new time.

Note:- Pressing Enter without entering a new time keeps


the current time.

time 12:00

Set the computer time to 12:00.

12) Color Command:-

The color command allows users running MS-DOS or the


Windows command line to change the default color of the
background or text.

syntax

Sets the default console foreground and background colors.

COLOR [attr]
Here, attr Specifies color attribute of console output.

Color attributes are specified by TWO hex digits -- the first


corresponds to the background; the second the foreground.
Each digit can be any of the below values.

0 = Black 8 = Gray

1 = Blue 9 = Light Blue

2 = Green A = Light Green

3 = Aqua B = Light Aqua

4 = Red C = Light Red

5 = Purple D = Light Purple

6 = Yellow E = Light Yellow

7 = White F = Bright White

If no argument is given, this command restores the color to


what it was when [Link] started. This value either comes
from the current console window, the /T command line
switch or from the "DefaultColor" registry value.

The COLOR command sets ERRORLEVEL to 1 if an attempt


is made to execute the COLOR command with a foreground
and background color that are the same.
Examples:-

Color 0A

Creates a black background with light bright green text,


similar to many of the FTP, telnet, and old BBS console
screens.

13) Title Command:-

The title command enables users to change the title of their


MS-DOS window.

Syntax:-

TITLE [string]

Here, string Specifies the title for the command prompt


window.

Example:-

title My work window

Change the title of the command line window to "My work


window." Using title can be helpful if you routinely have
multiple command windows open and need an easy way to
identify which window is doing what.

You might also like