DISK OPERATING SYSTEM (DOS)
1. Perform the following operations using DOS commands:
Change the system date
D:\>date
Change the System time
D:\>time
Clear the screen
D:\>cls
Use the copy con file to create a text file.
D:\>copy con first.txt
Hi. This is an example to create a new file using COPY CON
^Z
1
2. Demonstrate the following using DOS commands:
Change the drive to user working Drive
C:\Windows\system32>d:
D:\>
Display all the files from the drive
D:\> dir *.*
Display the Directory names
D:\> dir
Display the file types .txt
D:\> dir *.txt
Display the files with attributes( hidden, read-only, system)
Hidden Files:
D:\> dir /A:H
Read Only Files:
D:\> dir /A:R
System Files:
D:\> dir /A:S
2
3. Create a batch file to do the following:
Step 1: Open a notepad and type the following commands
Start windows- notepad
Step 2: Save the file as .bat
Step 3: Run the bat file in command prompt
Display the files in a directory with alphabetical order
C:\Windows\system32>dir /O:N
Print the current path of the directory
C:\Windows\system32>echo "Current Location is %cd%"
Display the “Welcome” message
C:\Windows\system32>echo "Welcome"
Display the files starting with character ‘d’
C:\Windows\system32>dir d*.*
Display the files having names with two characters and file type .dll
C:\Windows\system32>dir ??. dll
3
4. Create batch file to do the following:
Step 1: Open a notepad and type the following commands
Step 2: Save the file as .bat
Step 3: Run the bat file in command prompt
Display the current working directory
C:\Windows\system32>cd
C:\Windows\system32>d:
Create a new directory called “Student”
C:\Windows\system32>mkdir student
Change the directory to newly created directory
C:\Windows\system32>cd student
C:\Windows\system32\student>
Create two text files namely “user1” and “user2”
C:\Windows\System32\student>notepad user1.txt
C:\Windows\System32\student>notepad user2.txt
Rename the file “user1” to your name
C:\Windows\System32\student>ren user1.txt dev.txt
Display the files with its attributes
C:\Windows\System32\student>attrib
R - read-only file H - hidden file A - archive file S - system file.
Remove the newly created directory “Student”.
C:\Windows\System32>rm *.*
C:\Windows\System32>rmdir student
C:\Windows\System32>del student
4
5. Demonstrate the following DOS commands:
Display all files with extension .txt,
C:\Windows\System32>dir *.txt
Create three text files,
C:\Windows\System32\student>notepad myfile1.txt
C:\Windows\System32\student>notepad myfile2.txt
C:\Windows\System32\student>notepad myfile3.txt
Display the content of the text files one by one,
C:\Windows\System32\student>type myfile1.txt myfile2.txt myfile3.txt
Concatenate the three text files into one called “result.txt”,
C:\Windows\System32\student>copy /b myfile1.txt + myfile2.txt + myfile3.txt
result.txt
Rename the file “result.txt” to “NewName.txt”,
C:\Windows\System32\student>ren result.txt NewName.txt
Display the directory files by its creation date.
C:\Windows\System32\student>dir /O:D
N : By name (alphabetic).
S : By size (smallest first).
E : By extension (alphabetic).
D : By date/time (oldest first).
G : Group directories first.
- : Prefix to reverse order.
5
6. Demonstrate the following DOS commands: .
Display the files from the current directory
C:\Windows\System32\student> dir / b
Create a new directory called “New”
C:\Windows\System32\student>mkdir new
Copy all the .C files to the newly created directory
C:\Windows\System32\student>copy *.c
C:\Windows\System32\student\new
Change to the new directory
C:\Windows\System32\student>cd new
Display all the files from the New directory
C:\Windows\System32\student\new> dir /b
Remove the New Directory
Step 1: C:\Windows\System32\student\new>rm *.*
Step 2: C:\Windows\System32\student\new>rmdir new
6
7. Demonstrate the following DOS commands:
Display the files starting with ‘s’ and ending with ‘t’
C:\Users\Admin\Desktop>dir /b s*.* Show the files starting
with ‘s’
C:\Users\Admin\Desktop>dir /b *t.* Show the files ending
with ‘t’
Display files exactly three character in its name
C:\Users\Admin\Desktop>dir /b ???.*
Display the files with any name and extension .exe
C:\Users\Admin\Desktop>dir /b *.exe
Store all the current directory files to a file called “output.txt”
1. Create a File Output.txt in D: Colon
2. Open a Notepad and Type the following
@echo off
setlocal EnableExtensions DisableDelayedExpansion
set "OutputFile=C:\Test\output.txt"
del "%OutputFile%" 2>nul
for %%I in ("*.txt") do if /I not "%%~fI" == "%OutputFile%" for /F usebackq^
delims^=^ eol^= %%A in ("%%I") do >>"%OutputFile%" echo %%~nxI;%%A
endlocal
3. Save the filename as print.bat
4. Execute the file.
Sort and display the contents of the file “output.txt”.
D:\>sort d:\output.txt
7
WINDOWS OPERATING SYSTEM
1. Change the appearance of the windows desktop with new wallpaper and
Display settings.
Step:1
Right Click on the Deskop and select the Personalize menu.
8
Step:2
In the Background menu, choose your picture to be set a wallpaper.
Step:3
To change the Display Setting, right click on the Desktop and select the display
setting.
9
Step:4
In the Display Menu, We can change the Size of the screen by choosing Scale and
Layout, Display Resolution and Display Orientation.
10
2. Use the control panel to change the system date and time
Step:1
Right Click on the Date and Time which is placed in the Corner of the Taskbar.
Select the Adjust Date/Time menu.
Step:2
From the windows, select date and time menu. Turn OFF both the Set Time
Automatically and Set Time Zone Automatically. Finally, click the change button
under the Set the date and time manually.
11
Step:3
Adjust the System Date and Time and click the change button.
12
3. Using the windows folder to do the following: search and display the
selected files from the folder, Display the files with the extension .C, Delete
all the files with the extension .BAK
Step:1
Open the My Computer, select a Drive or a Folder which having files.
13
Step:2
(i) Search and display the selected files from the folder
On the search option, type a file name fully or partially with extension or without
extension.
Step:3
(ii) Display the files with the extension .C
Type *.c in the search box to display all the C files.
14
Step:4
(iii) Delete all the files with the extension .BAK
First type *,bak in the search box to search all the bak file from the folder. After
showing the .bak files, press Control+A to select all the files. Right click any one of
the file and select Delete menu to delete all the .bak files.
15
4. Do the following operations on folders and files: create a new folder,
change to the new folder, create some text files on the folder, rename any
one of the file to “reNamedFile”, Delete the file just renamed, Remove the
new folder created by you.
Create a new folder
Right Click on the desktop to select the Folder option from the New Menu.
Change to the new folder
16
Right Click on the Folder and select the Rename option to change the name of the
folder.
17
Create some text files on the folder
Open the Folder names My Folder. Right Click inside the Folder and select the
Text Document from the New Menu.
18
Rename any one of the file to “reNamedFile”
Right Click on the Text file and Select the Rename menu to change the name of
the file.
19
Delete the file just renamed
Select the text file and right click on the file. Select the delete menu to delete the
file.
Remove the new folder created by you.
Select the file. Right Click on the Folder and select the delete menu to delete the
folder
20
5. Demonstrate the following: Create a new text file using any text editor,
Display the text file on the folder, Change the file attributes to read-only
and hidden, Remove the file created by you.
Create a new text file using any text editor
Step:1
Open Notepad by using Windows Accessories from the Start Menu.
21
Step:2
Type something in the Notepad
Step:3
Save the file in a folder by using Save option in the File Menu.
22
Display the text file on the folder
Open the folder where the file you saved.
23
Change the file attributes to read-only and hidden
Step:1
Right Click on the Text File and select the Properties menu.
24
Step:2
Under the General Tab, tick the Read-Only and Hidden option. Click Apply and
then Ok
25
Remove the file created by you.
Right click on the Text File and select the delete menu to delete the Text File
26