In: Computer Science
Windows XP Command Line questions.
a) What is the command to display all of the files on the disk in drive A:--do not use the DIR command or the CHKDSK command C:\>
b) Display the contents of the PERSONAL.FIL file located in the root directory of drive A: one screenful at a time
C) Display the contents of the PERSONAL.FIL file located in the root directory of drive A:, one screenful at a time, beginning with the 25th record, on a clear screen using the MORE command.
D) What is the command to append the contents of the file named STEVEN.FIL to the file called CASES.FIL Both files are on the root directory of drive A:
E) Create a subdirectory under the HOMEWORK directory called CIT-40
F) Copy the file called NAME.NEW from the \TEMP directory into the \HOMEWORK\CIT-40 subdirectory
a) What is the command to display all of the files on the disk in drive A:--do not use the DIR command or the CHKDSK command C:\>
Answer: diskpart command: The diskpart command interpreter helps you manage your computer's drives (disks, partitions, volumes, or virtual hard disks).this command used for to display all of the files on the disk in drive.Before you can use diskpart commands, you must first list, and then select an object to give it focus. After an object has focus, any diskpart commands that you type will act on that object.
List Available objects
list disk
- Displays all the disks
on the computer.
list volume
- Displays all the
volumes on the computer.
list partition
- Displays the
partitions on the disk that has focus on the computer.
list vdisk
- Displays all the
virtual disks on the computer.
Syntax: diskpart <parameter>
How To Use Diskpart
If you want to use Diskpart, you need to open up a Windows command line or PowerShell terminal. Diskpart is a destructive tool, so you’ll need to open a terminal window with the right administrative privileges.
List All Files on the disk:
1.Click the Windows Start button and type "cmd" in the Start menu's search box. Click "cmd.exe" in the list that appears to open the Command window.
2.Type the "cd" command, followed by "/" to tell the Command window to switch to your hard drive's root drive. This is usually the "C" drive.
If you would like to list the files on another drive, type that drive's drive letter followed by a colon and press "Enter." To switch to your "E" drive, type the following:
E:
3.Type the "tree" command with the "/f" switch -- to display file names -- and the "/a" switch -- to use plain text -- followed by the name of the file where you would like to store the file listing into the window:
tree /f /a > myFile.txt
Press "Enter."
4.Specify the exact location of the file instead if you wish. If you would like to store the listing in a file named All_Files.txt in a folder named Listings on your C drive, the command would appear as listed below:
tree /f /a > C:\Listing\All_Files.txt
Press "Enter."
b) Display the contents of the PERSONAL.FIL file located in the root directory of drive A:
Answer:
1.Press "Win-E" to open Windows Explorer. The "Win" key is depicted with a Microsoft Windows symbol and may also contain the word "Start."
2.Click "Organize" from the toolbar and select "Folder and Search Options."
3.Click the "View" tab.
4.Click "Show Hidden Files, Folders, and Drives" from the Hidden Files and Folders list.
5.Uncheck "Hide Protected Operating System Files (Recommended)." As soon as you do, a window pops up warning you not to delete or edit system files and asks you if you really want to display these files. Click "Yes," but heed the warning.
6.Click "OK" to apply the setting changes and exit the window.
7.Double-click the hard drive under the right panel's Hard Disk Drives list. For your system drive, double-click the "C" drive. You should now see all the files and folders in the root folder of your hard drive.